设置SCSV密码时,不能在python ssl中选择密码

时间:2018-02-08 11:48:54

标签: python sockets ssl network-programming pyopenssl

我正在尝试使用python sslsocket来测试SCSV密码。

import ssl
import socket
import pprint
import M2Crypto

context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) 
context.set_ciphers("TLS_FALLBACK_SCSV")

host = "google.com"
port = 443

ssocket = socket.socket(socket.AF_INET , socket.SOCK_STREAM)
ssocketContex = context.wrap_socket(ssocket , do_handshake_on_connect = True,)

print "trying to connect to: " , host , ' in port:' , port
ssocketContex.settimeout(3) 
ssocketContex.connect((host, port))
ssocketContex.close()
print "closed socket"

但它无法设置密码,我收到此错误:

context.set_ciphers("TLS_FALLBACK_SCSV")
ssl.SSLError: ('No cipher can be selected.',)

0 个答案:

没有答案