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

Best way to sort table based on headers using Flask
python-get a sublist without changing position
tkinter: binding a function to a button that opens a simpledialog
diffrent views according to if user is logged in or not
User prompted odd or even lines from a text file
error when i try to test connection between python and mysql
Python pxssh execute iptables not working
How to find out what a python package does
Python PyGame KEYDOWN not working
How to show csv file in a grid?
How to for loop list all values into a dataframe? Python
Multidimensional vector classification
How do I install and use gdb inside a docker?
Combing two pandas dataframes, weaving same columns index/title next to one another
Is there an effective way to hide an inline keyboard with python telegram bot?
Overriding django current app in a django template

Categories

HOME
google-apps-script
jsf
itext
extract
angular2-directives
orientation
flyway
hyperledger-fabric
xtext
java-home
apiconnect
sudo
eclipse-cdt
hosts
opera-mini
yeoman-generator
jcl
ng-show
jogl
pycrypto
tweets
google-maps-android-api-2
ghost-inspector
activepython
vcard
aurelia-binding
autofill
pygooglechart
xor
referenceerror
postgresql-9.2
read-write
stocks
nunit-3.0
boilerplate
elfinder
poco-libraries
duktape
active-model-serializers
linq-to-entities
socketscan
tango
dojox.mobile
taglib
catia
asmx
fqdn
data-integration
execl
infinite-scroll
uicollectionviewlayout
unity3d-editor
inject
tomee
pydio
webkit2
bacnet
multiple-file-upload
multifile-uploader
gradle-eclipse
gmsmapview
picking
drf-nested-routers
retro-computing
response-headers
programming-paradigms
xjc
coypu
jazz
sqoop2
fragment-tab-host
dto
aquafold
kraken.js
windows-mobile-6
goinstant
nscolor
mozart-mvc
blockingqueue
javascriptserializer
makefile-project
point-sprites
datamember
msbuildextensionpack
adsl
ruby-debug
clause
getresource
revert
external-assemblies
swfloader
lazy-c++

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