Search code examples
pythongoogle-app-enginegoogle-cloud-platformphpstorm

SSLHandshakeError - Google App Engine


I am working on a simple project on PhpStorm and installed GAE plugin and SDK. Running a server and show the project works, but when I try to deploy my application I get this kind of error: (This is a PHP project)

C:\Python27\python.exe "C:/Users/asim/AppData/Local/Google/Cloud SDK/google-cloud-sdk/platform/google_appengine/appcfg.py" update .
10:08 AM Application: gtmdocx; version: None
10:08 AM Host: appengine.google.com
Traceback (most recent call last):
  File "C:/Users/asim/AppData/Local/Google/Cloud SDK/google-cloud-sdk/platform/google_appengine/appcfg.py", line 133, in <module>
    run_file(__file__, globals())
  File "C:/Users/asim/AppData/Local/Google/Cloud SDK/google-cloud-sdk/platform/google_appengine/appcfg.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py", line 5518, in <module>
    main(sys.argv)
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py", line 5509, in main
    result = AppCfgApp(argv).Run()
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py", line 2969, in Run
    self.action(self)
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py", line 5165, in __call__
    return method()
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py", line 3897, in Update
    self._UpdateWithParsedAppYaml(appyaml, self.basepath)
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py", line 3918, in _UpdateWithParsedAppYaml
    updatecheck.CheckForUpdates()
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\sdk_update_checker.py", line 245, in CheckForUpdates
    runtime=runtime))
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 246, in Send
    url, method=method, body=payload, headers=headers)
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\httplib2\httplib2\__init__.py", line 1626, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\httplib2\httplib2\__init__.py", line 1368, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\httplib2\httplib2\__init__.py", line 1288, in _conn_request
    conn.connect()
  File "C:\Users\asim\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\httplib2\httplib2\__init__.py", line 1082, in connect
    raise SSLHandshakeError(e)
httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

Process finished with exit code 1

I've tried to uninstall and upgrade Python, now I'm using 2.7.9 but still this error wont remove. I tried also removing cacerts.txt but still no luck still this problem

ttplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

I hope anyone has encountered this problem before and can help me with this.

Here is my App.yaml file:

runtime: php55
api_version: 1
threadsafe: true
service: default
application: gtmdocx

handlers:
- url: .*
  script: main.php
  login: admin

Solution

  • Finally got it working. Using PHPstorm IDE for deploying don't work, but using gcloud in command line works perfectly for deploying. Maby PHPstorm adds some config or parameters when deploying but i used the command line and it worked like charm

     gcloud app deploy app.yaml --project <project name> --promote --quiet
    

    Hope this helps someone.