e.g. latimes.com
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 55, in lambda_handler
output_data, hostname = scanner.scanner_driver(input_data)
File "/opt/python/lib/python3.7/site-packages/cryptonice-1.3.7.1-py3.7.egg/cryptonice/scanner.py", line 414, in scanner_driver
force_redirect)
File "/opt/python/lib/python3.7/site-packages/cryptonice-1.3.7.1-py3.7.egg/cryptonice/gethttp.py", line 124, in get_http
conn.request("GET", str_path)
File "/var/lang/lib/python3.7/http/client.py", line 1277, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/var/lang/lib/python3.7/http/client.py", line 1323, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/var/lang/lib/python3.7/http/client.py", line 1272, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/var/lang/lib/python3.7/http/client.py", line 1032, in _send_output
self.send(msg)
File "/var/lang/lib/python3.7/http/client.py", line 972, in send
self.connect()
File "/var/lang/lib/python3.7/http/client.py", line 1439, in connect
super().connect()
File "/var/lang/lib/python3.7/http/client.py", line 944, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/var/lang/lib/python3.7/socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/var/lang/lib/python3.7/socket.py", line 752, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
This one is interesting. If you manually go to latimes.com using openssl s_client, you can see this:
GET / HTTP/1.0
HTTP/1.1 301 Moved Permanently
Server: awselb/2.0
Date: Thu, 01 Jul 2021 20:15:23 GMT
Content-Type: text/html
Content-Length: 134
Connection: close
Location: https://www.internal-caltimes-root-redirector-alb-1421749447.us-west-2.elb.amazonaws.com:443/
openssl s_client -connect www.internal-caltimes-root-redirector-alb-1421749447.us-west-2.elb.amazonaws.com:443
getaddrinfo: Name or service not known
connect:errno=2
Thus the error. Attempting to connect to the Location uri using curl gives the same error.
In a browser, however, it works fine.