Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-09-2017, 11:43 AM   #1
Bengb
Junior Member
Bengb began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2010
Device: none
SSL: CERTIFICATE_VERIFY_FAILED Error

Hello,
I could use some help in fixing a "SSL: CERTIFICATE_VERIFY_FAILED" (see Details below) whenever I try to download metadata. I also receive an error whenever I try to access and/or update plugins. I am running windows 10 and am using windows defender antivirus and the windows firewall. I have deleted and remade the incoming and outgoing firewall rules for calibre and have uninstalled and reinstalled calibre with no success. Below are the details of the error msgs I receive.

Downloading Metadata Details:

calibre, version 3.3.0
ERROR: No matches found: <p>Failed to find any books that match your search. Try making the search <b>less specific</b>. For example, use only the author's last name and a single distinctive word from the title.<p>To see the full log, click "Show details".

Running identify query with parameters:
{u'title': u'The Swordswoman', u'authors': [u'Malcolm Archibald'], u'identifiers': {}, u'timeout': 30}
Using plugins: Fantastic Fiction (1, 1, 6), FictionDB (1, 0, 10), Google (1, 0, 0), Amazon.com (1, 2, 0)
The log from individual plugins is below

Spoiler:
****************************** FictionDB (1, 0, 10) ******************************
Found 0 results
Downloading from FictionDB took 0.476000070572
Querying: http://www.fictiondb.com/search/searchresults.php - author=Malcolm+Archibald&pubgroup=&title=The+Sword swoman&synopsis=&rating=-&styp=6&isbn=None&anthology=&srchtxt=multi&imprint =&datepublished=
Failed to make identify query: u'http://www.fictiondb.com/search/searchresults.php' - 'author=Malcolm+Archibald&pubgroup=&title=The+Swor dswoman&synopsis=&rating=-&styp=6&isbn=None&anthology=&srchtxt=multi&imprint =&datepublished='
Traceback (most recent call last):
File "calibre_plugins.fictiondb.__init__", line 115, in identify
File "site-packages\mechanize\_mechanize.py", line 239, in open_novisit
File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open
File "site-packages\mechanize\_opener.py", line 206, in open
File "site-packages\mechanize\_urllib2_fork.py", line 467, in http_response
File "site-packages\mechanize\_opener.py", line 224, in error
File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain
File "site-packages\mechanize\_urllib2_fork.py", line 586, in http_error_302
File "site-packages\mechanize\_mechanize.py", line 254, in open
File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open
File "site-packages\mechanize\_opener.py", line 195, in open
File "site-packages\mechanize\_urllib2_fork.py", line 352, in _open
File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain
File "site-packages\calibre\utils\browser.py", line 28, in https_open
File "site-packages\mechanize\_urllib2_fork.py", line 1160, in do_open
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

************************************************** ******************************

****************************** Amazon.com (1, 2, 0) ******************************
Found 0 results
Downloading from Amazon.com took 0.286000013351
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.7 (KHTML, like Gecko) Version/9.1.2 Safari/601.7.7
Server: google
Making google query: https://www.google.com/search?q=Swor...www.amazon.com
Plugin Amazon.com failed
Traceback (most recent call last):
File "site-packages\calibre\ebooks\metadata\sources\identify. py", line 48, in run
File "site-packages\calibre\ebooks\metadata\sources\amazon.py ", line 1336, in identify
File "site-packages\calibre\ebooks\metadata\sources\amazon.py ", line 1272, in search_search_engine
File "site-packages\calibre\ebooks\metadata\sources\search_en gines.py", line 224, in google_search
File "site-packages\calibre\ebooks\metadata\sources\search_en gines.py", line 59, in query
File "site-packages\mechanize\_mechanize.py", line 239, in open_novisit
File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open
File "site-packages\mechanize\_opener.py", line 195, in open
File "site-packages\mechanize\_urllib2_fork.py", line 352, in _open
File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain
File "site-packages\calibre\utils\browser.py", line 28, in https_open
File "site-packages\mechanize\_urllib2_fork.py", line 1160, in do_open
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

************************************************** ******************************

****************************** Fantastic Fiction (1, 1, 6) ******************************
Found 0 results
Downloading from Fantastic Fiction took 1.40700006485
Querying ISBN: http://script.fantasticfiction.co.uk/ff-v3.php
Querying: http://www.fantasticfiction.co.uk/db...fo,db,imageloc
Failed to make identify query
Traceback (most recent call last):
File "calibre_plugins.fantastic_fiction.__init__", line 275, in identify
File "site-packages\mechanize\_mechanize.py", line 239, in open_novisit
File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open
File "site-packages\mechanize\_opener.py", line 206, in open
File "site-packages\mechanize\_urllib2_fork.py", line 467, in http_response
File "site-packages\mechanize\_opener.py", line 224, in error
File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain
File "site-packages\mechanize\_urllib2_fork.py", line 586, in http_error_302
File "site-packages\mechanize\_mechanize.py", line 254, in open
File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open
File "site-packages\mechanize\_opener.py", line 195, in open
File "site-packages\mechanize\_urllib2_fork.py", line 352, in _open
File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain
File "site-packages\calibre\utils\browser.py", line 28, in https_open
File "site-packages\mechanize\_urllib2_fork.py", line 1160, in do_open
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

************************************************** ******************************

****************************** Google (1, 0, 0) ******************************
Found 0 results
Downloading from Google took 0.286000013351
Making query: https://books.google.com/books/feeds...&start-index=1
Failed to make identify query: u'https://books.google.com/books/feeds/volumes?max-results=20&min-viewability=none&q=intitle%3ASwordswoman%2Binautho r%3AMalcolm+inauthor%3AArchibald&start-index=1'
Traceback (most recent call last):
File "site-packages\calibre\ebooks\metadata\sources\google.py ", line 362, in identify
File "site-packages\mechanize\_mechanize.py", line 239, in open_novisit
File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open
File "site-packages\mechanize\_opener.py", line 195, in open
File "site-packages\mechanize\_urllib2_fork.py", line 352, in _open
File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain
File "site-packages\calibre\utils\browser.py", line 28, in https_open
File "site-packages\mechanize\_urllib2_fork.py", line 1160, in do_open
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

************************************************** ******************************
The identify phase took 1.61 seconds
The longest time (1.407000) was taken by: Fantastic Fiction
Merging results from different sources and finding earliest publication dates from the worldcat.org service
We have 0 merged results, merging took: 0.00 seconds


PLUG IN ERROR MSG BELOW
===========================================

calibre, version 3.3.0
ERROR: Update Check Failed: Unable to reach the plugin index page.

Traceback (most recent call last):
File "site-packages\calibre\gui2\dialogs\plugin_updater.py", line 441, in __init__
File "site-packages\calibre\gui2\dialogs\plugin_updater.py", line 65, in read_available_plugins
File "site-packages\calibre\utils\https.py", line 202, in get_https_resource_securely
File "httplib.py", line 1278, in connect
File "ssl.py", line 353, in wrap_socket
File "ssl.py", line 601, in __init__
File "ssl.py", line 830, in do_handshake
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

I consider myself a midlevel user w/no programming/language experience who is able to follow simple directions. I have seen where Kovid has stated that the above certificate error is on the users end but other than allowing incoming and outgoing firewall rules for calibre, I don't know what else I could do. Any/all help in resolving this issue will be deeply appreciated. Bengb

Last edited by BetterRed; 07-09-2017 at 06:03 PM.
Bengb is offline   Reply With Quote
Old 07-09-2017, 12:33 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Given you are getting SSL certificate errors for all sites, I am guessing you have some kind of man-in-the-middle SSL proxy installed on your computer. Either it is malware or security software.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-18-2017, 07:24 AM   #3
MattC123
Junior Member
MattC123 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2017
Device: Kindle
I'm getting the same error while trying to access the site from work, and in my case I know there's a HTTPS filtering firewall in the way.

I have the certificate for the firewall available so what I need to know is either

1/ How to install it so calibre picks it up.
or
2/ How to turn off the certificate verification.

I've looked at the various Python sites to try and work out what to do, but so far have failed to find an answer.

Matt
MattC123 is offline   Reply With Quote
Old 07-18-2017, 07:54 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Depends on the OS. calibre uses openssl which usually picks up the certificates installed in the OS. You can also force it to use a particualr set of certificates by setting the SSL_CERT_FILE or SSL_CERT_DIR environment variables.
kovidgoyal is offline   Reply With Quote
Old 07-18-2017, 09:22 AM   #5
MattC123
Junior Member
MattC123 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2017
Device: Kindle
It's on Windows, which is where I was having the problem.

I noticed there were already some certificates installed as part of Calibre and was a bit concerned in case I broke other functionality.
MattC123 is offline   Reply With Quote
Advert
Old 07-18-2017, 09:56 AM   #6
MattC123
Junior Member
MattC123 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2017
Device: Kindle
Hi

I tried setting the environment variables as suggested, but that didn't work and reading other posts there seem to be bugs in the Windows python in this area.

I finally managed to make this work by exporting the certificate from Firefox and appending it to the end of the C:\Program Files (x86)\Calibre2\app\resources\calibre-ebook-root-CA.crt file.

Thanks for the help.
Matt
MattC123 is offline   Reply With Quote
Old 07-22-2017, 03:07 PM   #7
Steven Karp
Enthusiast
Steven Karp began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2014
Device: Windows 10 Tablet / Calibre or Nexus 9 / Moon+
I'm getting this certificate failure against code.calibre-ebook.com when I try to upgrade any of several Linux machines.

wget reports "Unable to locally verify the issuer's authority." and Firefox says

Code:
code.calibre-ebook.com uses an invalid security certificate.

The certificate is not trusted because the issuer certificate is unknown. The server might not be sending the appropriate intermediate certificates. An additional root certificate may need to be imported

Error code: SEC_ERROR_UNKNOWN_ISSUER
This had been working as recently as 7/15. Has something changed at that end in the past week?
Steven Karp is offline   Reply With Quote
Old 07-22-2017, 03:19 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
code.calibre-ebook.com uses a private certificate, and that has always been the case. You want to verify it you have to use the certificate in the calibre installation's resources directory calibre-ebook-root-CA.crt

If you use some kind of MITM proxy then connections to it will always fail, unless you replace that file with your proxy's CA certificate, as MattC123 did.
kovidgoyal is offline   Reply With Quote
Old 07-23-2017, 06:17 PM   #9
Steven Karp
Enthusiast
Steven Karp began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2014
Device: Windows 10 Tablet / Calibre or Nexus 9 / Moon+
Quote:
Originally Posted by kovidgoyal View Post
code.calibre-ebook.com uses a private certificate, and that has always been the case. You want to verify it you have to use the certificate in the calibre installation's resources directory calibre-ebook-root-CA.crt
Yeah, I get that, and I've got my update script working by blessing your certificate.

But that doesn't answer the question of what changed to break the script. That checks the latest version via http://calibre-ebook.com/downloads/latest_version, which isn't secure, but redirects to code.calibre-ebook.com in secure mode. Has that redirection always been in place?

If so, then the most likely culprit is a change in OpenSUSE's latest batch of updates.
Steven Karp is offline   Reply With Quote
Old 07-24-2017, 12:29 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The change is that the calibre-ebook.com server no longer allows http access. All http requests are redirected to https.

You want to check the latest version over http, use http://code.calibre-ebook.com/latest

That is the correct URL for checking for the latest version anyway.
kovidgoyal is offline   Reply With Quote
Old 07-24-2017, 11:56 AM   #11
Steven Karp
Enthusiast
Steven Karp began at the beginning.
 
Posts: 29
Karma: 10
Join Date: May 2014
Device: Windows 10 Tablet / Calibre or Nexus 9 / Moon+
Quote:
Originally Posted by kovidgoyal View Post
The change is that the calibre-ebook.com server no longer allows http access. All http requests are redirected to https.
Yeah, that'd do it. Thanks for the explanation.

Quote:
That is the correct URL for checking for the latest version anyway.
Updating my script now to eliminate the redirect. No reason not to check securely, and plenty of good reasons to do so.

Thanks again.
Steven Karp is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aeon.co - Recipe download failed - CERTIFICATE_VERIFY_FAILED emanu Recipes 13 07-16-2016 12:29 AM
SSL Error Connecting on Mac OSX JimmXinu Calibre 7 01-30-2016 12:17 PM
IRC SSL cert jgoguen Feedback 0 08-03-2015 12:38 PM
Does CC support SSL connection? coleman Calibre Companion 7 04-03-2014 11:31 PM


All times are GMT -4. The time now is 01:40 AM.


MobileRead.com is a privately owned, operated and funded community.