python


SSLHandshakeError when connecting to Google Analytics using Google APIs Client Library for Python


I'm trying to connect to Google Analytics using a Service Account, but I get the following error:
SSLHandshakeError at ...
[Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
I have PyOpenSSL and PyCrypto installed and updated.
Here's the code I use to connect:
from oauth2client.client import SignedJwtAssertionCredentials
from apiclient.discovery import build
import httplib2
def initialize_service():
f = open('path_to_key_file.p12', 'rb')
key = f.read()
f.close()
credentials = SignedJwtAssertionCredentials('XXXX#developer.gserviceaccount.com', key, scope='https://www.googleapis.com/auth/analytics.readonly')
http = httplib2.Http()
http = credentials.authorize(http)
print 'This is printed'
service = build('analytics', 'v3', http=http)
print 'This is not printed'
return service
It seems that the problem occurred because the system clock wasn't set to the current time.

Related Links

always serializer is invalid
How do I flatten a hierarchical column index in a pandas DataFrame?
Why does 'while' cause the program to run longer in Python
QuerySet to JSON with nested objects
Python: How to populate Pandas column that depends on the previous value (previous row)?
Error with the open() function in python [closed]
Fine tuning pretrained model in keras
Getting the derivatives of Legendre polynomials in Python
Most recommended/used library for desiging POM code (Python)
how can I add dictionaries in dictionary
Too many to unpack tuple NLTK Chat
CNTK Python how to pass multiple features into model
Python Pandas GroupBy % calculation
Programmatic copy and paste XML Node in MS Word Document?
What specific requirements does the function passed to scipy.optimize.curve_fit need to fulfill in order to run?
Organizing daily Excel data into xarray dataset

Categories

HOME
sql-server-2008
dotnetrdf
symfony
nlp
wsdl
warnings
actionscript
playframework
docker-swarm
chaiscript
is-empty
ios10
ext.net
schemacrawler
gimp
eclipse-cdt
nixos
spinnaker
viber
gwtp
python-unicode
google-api-java-client
ios10.3
distance
sonarqube-msbuild-runner
excel-2010
lync-2013
upnp
nesc
vertex-buffer
pygooglechart
red-black-tree
protobuf-net
outsystems
graph-databases
superpowered
wfp
intellij-idea-2016
jupyter-console
tango
pdftk
estimation
lumen-5.3
aqgridview
workflow-foundation-4.5
struts-layout
pluck
openh264
quintus
addin-express
gmt
gulp-typescript
payu
windows-azure-pack
excon
uiprogressview
freetype2
multiple-file-upload
spring-lemon
emokit
freefem++
proxygen
insertion-sort
data-import
windows-vista
zuora
app.xaml
datasnap
leadtools-sdk
harp
virus
custom-url
utf-32
cpu-speed
ultrawingrid
node-inspector
dalekjs
aquafold
neoload
modeshape
jqmobi
va-list
ng-pattern
qtgui
domain-calculus
mpmovieplayer
unions
jquery-selectbox
shared-objects
for-xml-path
front-controller
usability-testing
standardized

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App