コード例 #1
0
 def test_write_bad(self):
     # No BIO attached to the SSL object
     test_ssl = _nassl_legacy.SSL(
         _nassl_legacy.SSL_CTX(OpenSslVersionEnum.SSLV23.value))
     test_ssl.set_connect_state()
     with pytest.raises(_nassl.OpenSSLError, match='ssl handshake failure'):
         test_ssl.write('tests')
コード例 #2
0
 def test_do_handshake_bad_eof(self):
     # No BIO attached to the SSL object
     test_ssl = _nassl_legacy.SSL(
         _nassl_legacy.SSL_CTX(OpenSslVersionEnum.SSLV23.value))
     test_ssl.set_connect_state()
     with pytest.raises(
             _nassl.SslError,
             match='An EOF was observed that violates the protocol'):
         test_ssl.do_handshake()
コード例 #3
0
 def test_set_cipher_list_bad(self):
     # Invalid cipher string
     test_ssl = _nassl_legacy.SSL(
         _nassl_legacy.SSL_CTX(OpenSslVersionEnum.SSLV23.value))
     with pytest.raises(_nassl.OpenSSLError):
         test_ssl.set_cipher_list('badcipherstring')