我正在尝试使用python ssl
和socket
来测试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.',)