Question: Invalid and/or missing SSL certificate for URL when calling


Invalid and/or missing SSL certificate for URL when calling

Answers 1
Added at 2017-01-02 04:01

So I'm running my google endpoint locally with I use the API explorer to test the application.

The code I'm using to create the Service, so I can call the API is the following:

from apiclient.discovery import build 
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
service = build('speech', 'v1beta1', credentials=credentials)

I receive an SSL error (Invalid and/or missing SSL certificate), even though when I access the stated URL via browser it works fine (that is, the green padlock shows up).

I'm not sure what changed, but this was working fine not long ago.

I tried to disable SSL checking, but was unable to.

Full logs below:

INFO     2017-01-02 03:12:02,724] URL being requested: GET
ERROR    2017-01-02 03:12:03,022] 
Traceback (most recent call last):
  File "/home/vini/opt/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/home/vini/opt/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/home/vini/opt/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/", line 85, in LoadObject
    obj = __import__(path[0])
  File "/mnt/b117/home/vini/udacity/cerci-endpoint/", line 28, in <module>
    service = build('speech', 'v1beta1', credentials=credentials)
  File "/mnt/b117/home/vini/udacity/cerci-endpoint/lib/oauth2client/", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/mnt/b117/home/vini/udacity/cerci-endpoint/lib/googleapiclient/", line 222, in build
  File "/mnt/b117/home/vini/udacity/cerci-endpoint/lib/googleapiclient/", line 269, in _retrieve_discovery_doc
    resp, content = http.request(actual_url)
  File "/mnt/b117/home/vini/udacity/cerci-endpoint/lib/httplib2/", line 1609, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/mnt/b117/home/vini/udacity/cerci-endpoint/lib/httplib2/", line 1351, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/mnt/b117/home/vini/udacity/cerci-endpoint/lib/httplib2/", line 1307, in _conn_request
    response = conn.getresponse()
  File "/home/vini/opt/google-cloud-sdk/platform/google_appengine/google/appengine/dist27/gae_override/", line 532, in getresponse
    raise HTTPException(str(e))
HTTPException: Invalid and/or missing SSL certificate for URL:

Any ideas what could be causing this problem?

Do I have to "install" or update the SSL certificates used by python?

Answers to

Invalid and/or missing SSL certificate for URL when calling

nr: #1 dodano: 2017-01-02 10:01

According to App Engine issue 13477 it seems that some of the certificates found in urlfetch_cacerts.txt that is included in the App Engine Python SDK / gcloud-sdk expired 2017-01-01.

A temporary workaround until a new version of the app-engine-python component of gcloud-sdk is released with updated cacerts is to remove the expired certificates with serial=023A76 and serial=023A83 in urlfetch_cacerts.txt located in <your-cloud-sdk-path>/platform/google_appengine/lib/cacerts/

Source Show
◀ Wstecz