1 year ago
#73825
Sue-Kay
Connecting to an ipv6 website using OpenSSL
I tried this code which I got from a reference to connect to ipv6 server using OpenSSL inorder to take the SSL certificate documentation of an ipv6 website.
ctx = ssl.SSLContext(ssl.TLS_method) #SSLv23_METHOD
ctx.set_verify(ssl.VERIFY_NONE, verify_cb)
ctx.use_privatekey_file (os.path.join(dir, 'client.pkey'))
ctx.use_certificate_file(os.path.join(dir, 'client.cert'))
ctx.load_verify_locations(os.path.join(dir, 'CA.cert'))
#Set up client
sock = ssl.Connection(ctx, socket.socket(socket.AF_INET6, socket.SOCK_STREAM))
sock.connect(('2406:da18:9be:7600::/64',443,0,2))
But i'm getting the following error:
<ipython-input-1-073384200f70> in <module>
5 import certifi
6
----> 7 ctx = ssl.SSLContext(ssl.TLS_method) #SSLv23_METHOD
8 ctx.set_verify(ssl.VERIFY_NONE, verify_cb)
9 ctx.use_privatekey_file (os.path.join(dir, 'client.pkey'))
AttributeError: module 'ssl' has no attribute 'TLS_method'
it was so hard to find a method to get the SSL certification for the ipv6 website although there is a method for ipv4. Can you help me to find the issue in here and are there any other ways to get the ipv6 SSL certification?
python
ssl
ssl-certificate
ipv6
0 Answers
Your Answer