Skip to content

Commit

Permalink
Merge pull request #96 from Bouska/feature/ipv6
Browse files Browse the repository at this point in the history
Support for IPv6 added
  • Loading branch information
satanas committed Dec 30, 2015
2 parents 732322d + 5bf307e commit 51d07b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libturpial/lib/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ def __validate_ssl_cert(self, request):
port = 443

ip = socket.getaddrinfo(host, port)[0][4][0]
sock = socket.socket()
if ':' in ip:
family = socket.AF_INET6
else:
family = socket.AF_INET

sock = socket.socket(family)
sock.connect((ip, port))

sock = ssl.wrap_socket(sock, cert_reqs=ssl.CERT_REQUIRED,
Expand Down

0 comments on commit 51d07b0

Please sign in to comment.