Notice that the function returns emptystring for certificates that are `Ok`, and returns a string starting with \n otherwise.
Witness that the string concatenation is the same as before, just in JS instead of C++.
Notice that using these functions without an instance allows ToJSVal to use it without refering to g_XmppClient (and without having to add something to IXmppClient).
Notice that utf8 support is currently broken and that this is actually taken from the diff to fix it in a better way than the banal way: D2271.
One can test individual strings to be displayed by changing the according line in `XmppClient::onDisconnect` to
> "certificate_status", CertStatusToString(/*m_certStatus*/static_cast<gloox::CertStatus>(0)));
Observe the certificate status is always `Ok` i.e. translated to empty string unless `ConnTlsFailed`.
Hence check the specs on `onTLSConnect`:
```
/**
* This function is called when the TLS handshake completed correctly. The return
* value is used to determine whether or not the client accepted the server's
* certificate. If @b false is returned the connection is closed.
* @param info Information on the server's certificate.
* @return @b True if the certificate seems trustworthy, @b false otherwise.
*/
bool notifyOnTLSConnect( const CertInfo& info );
```
Which proves that statement in theory.
`m_certStatus` is only set in `onTLSConnect`, so its `m_certStatus = 0` by default.
Actually it is `m_certStatus = undefined / uninitialized` by default, great, that is fixed hereby now.