These 2 small patches done in pfSense fixes following issues:
1. When CN doesn't match, stream_socket_enable_crypto() throws a PHP warning. Suppress it and only log the error that happened
github.com/pfsense/pfsense/commit/2
...
2. Respect debug flag before call OutputDebug (maybe move the check inside function would be smarter)
github.com/pfsense/pfsense/commit/e
...