When using ssl_version of TLSv1_2 and the receiver is using tls version 1.0, will it honor both tls version 1 and 1.2?
conn.use_ssl = useSSL
conn.ssl_version="TLSv1_2"
conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
When using ssl_version of TLSv1_2 and the receiver is using tls version 1.0, will it honor both tls version 1 and 1.2?
conn.use_ssl = useSSL
conn.ssl_version="TLSv1_2"
conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
Copyright © 2021 Jogjafile Inc.
By setting
conn.ssl_version="TLSv1_2", you are forcing the TLS version to exactly TLS 1.2. thus, the connection will be negotiated either with this exact version, or not at all. If the server only offers TLS 1.0, TLS 1.1 or even (exclusively) TLS 1.3, then the connection will not be established.Note that this is unrelated to the
verify_modewhich only affects how the certificates presented by the server are validated. WithOpenSSL::SSL::VERIFY_NONE, you are telling the client that it should not check whether the certificates can be validated against any trusted root certificates. The server must still provide a syntactically valid certificate and "correct" encryption.