<div dir="ltr">Both the protocol and protocolString methods in QSslCipher return a different value than what is expected. For example, in Qt 4.8 if you set the protocol in QSslSocket to QSsl::TlsV1 and connect to <a href="http://blog.mozilla.org" target="_blank">blog.mozilla.org</a> port 443, you get the following output from QSslCipher:<div><br></div><div><div><div>QSslSocket Information:</div><div>==================</div><div>protocol: 5</div><div><br></div><div>QSslCipher Information:</div><div>=================</div><div>name: DHE-RSA-AES128-SHA</div><div>authenticationmethod: RSA</div><div>encryptionMethod: AES(128)</div><div>keyExchangeMethod: DH</div><div>protocol: 0</div><div>protocolString: SSLv3</div><div>supportedBits: 128</div><div>usedBits: 128</div></div></div><div><br></div><div>However if one uses openssl directly, the following information is returned:</div><div><br></div><div><div>$ openssl s_client -connect <a href="http://blog.mozilla.org:443" target="_blank">blog.mozilla.org:443</a></div><div><br></div><div><certificate snipped></div><div><br></div></div><div><div>subject=/C=US/ST=CA/L=Mountain View/O=Mozilla Corporation/CN=<a href="http://generic-san.mozilla.org" target="_blank">generic-san.mozilla.org</a></div><div>issuer=/C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA</div><div>---</div><div>No client certificate CA names sent</div><div>---</div><div>SSL handshake has read 3845 bytes and written 522 bytes</div><div>---</div><div>New, TLSv1/SSLv3, Cipher is DHE-RSA-AES128-SHA</div><div>Server public key is 2048 bit</div><div>Secure Renegotiation IS supported</div><div>Compression: NONE</div><div>Expansion: NONE</div><div>SSL-Session:</div><div>    Protocol  : TLSv1.1</div><div>    Cipher    : DHE-RSA-AES128-SHA</div><div>    Session-ID: EA0ECB6221F00F22BF082CA189CA9587EDA0572CDB6340058C2FADC0FBCE6FCA</div><div>    Session-ID-ctx: </div><div>    Master-Key: 52A00273C65B278A2BD71153C2543BA4301569C84DC68878E574F0DF6B1115930E008A1B5D293DCBF9EB04F8F3FA1121</div><div>    Key-Arg   : None</div><div>    PSK identity: None</div><div>    PSK identity hint: None</div><div>    SRP username: None</div><div>    Start Time: 1413727556</div><div>    Timeout   : 300 (sec)</div><div>    Verify return code: 20 (unable to get local issuer certificate)</div><div>---</div><div><br></div><div>So the negotiated protocol when using openSSL directly is returned as TLSv1.1 where as QSslCipher almost always returns SSLv3. My question is why the negotiated protocol in QSslCipher is different from the one we get through openssl directly? Is the socket protocol a different thing from the cipher protocol? If so, then what KTcpSocket::negotiatedSslVersionName()  returns must be wrong as well.</div><div><br></div><div>Anyhow, I am asking this because of bug# 340047.</div><div><br></div><div>Since tcpslavebase.cpp calls KTcpSocket::negotiatedSslVersionName() which in turn calls QSslCipher::protocolString() to obtain the SSL protocol used, the SSL protocol information sent back to the clients is the one from QSslCipher. Unfortunately that seems to almost always return "SSLv3".</div><div><br></div><div>I have attached the program I used to print out the contents of QSslCipher.</div></div></div>