Author axot
Recipients axot
Date 2020-10-19.02:18:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
import ssl
import urllib.request

url_string = "https://kubernetes.default.svc.cluster.local./api/"

ctx = ssl._create_unverified_context()

with urllib.request.urlopen(url_string, context=ctx) as f:

In running this sample code will got a following handshake error,

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/urllib/", line 222, in urlopen
    return, data, timeout)
  File "/usr/lib/python3.8/urllib/", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/", line 1393, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/", line 1353, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: SSLV3_ALERT_UNEXPECTED_MESSAGE] sslv3 alert unexpected message (_ssl.c:1123)>

Instead using absolute domain name, using `https://kubernetes.default.svc.cluster.local/api/` then the issue solved. I also tried other domains like ``, but in this case the handshake process had no errors.
Date User Action Args
2020-10-19 02:18:56axotsetrecipients: + axot
2020-10-19 02:18:56axotsetmessageid: <>
2020-10-19 02:18:56axotlinkissue42077 messages
2020-10-19 02:18:55axotcreate