developmentseed / landsat-util

A utility to search, download and process Landsat 8 satellite imagery
Creative Commons Zero v1.0 Universal
689 stars 147 forks source link

SSLError in Docker container #246

Closed dbaston closed 6 years ago

dbaston commented 6 years ago

I get an SSLError when running the following command:

docker run -it developmentseed/landsat-util:latest landsat search --lat 38.9004204 --lon -77.0237117

Stack trace is:

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Traceback (most recent call last):
  File "/usr/local/bin/landsat", line 9, in <module>
    load_entry_point('landsat-util==0.13.1', 'console_scripts', 'landsat')()
  File "/landsat/landsat/landsat.py", line 488, in __main__
    print(main(args))
  File "/landsat/landsat/landsat.py", line 357, in main
    geojson=args.geojson)
  File "/landsat/landsat/search.py", line 96, in search
    r = requests.get('%s?search=%s&limit=%s' % (self.api_url, search_string, limit))
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 69, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 431, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error

It seems to be resolved by opening a shell in the container and running

pip install requests[security]

matthewhanson commented 6 years ago

This has been fixed in the Dockerfile on the develop branch.