Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-07-2018, 11:25 PM   #1
Naenyn
Junior Member
Naenyn began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: none
Exclamation Accessing Calibre running SSL via HTTP breaks the server

Hello!

I recently got myself a cert and have been working to secure the various services I run, one of those being Calibre. I added my cert/key to Calibre and everything works great when accessed from a browser via https. However, if I try to hit the server afterwards via http, I get the following:

Code:
Error in ServerLoop.tick
Traceback (most recent call last):
  File "site-packages/calibre/srv/loop.py", line 460, in serve
  File "site-packages/calibre/srv/loop.py", line 518, in tick
  File "site-packages/calibre/srv/loop.py", line 273, in drain_ssl_buffer
  File "site-packages/calibre/srv/loop.py", line 83, in recv_from
  File "ssl.py", line 771, in recv_into
  File "ssl.py", line 641, in read
SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1754)
After that, the server becomes unresponsive via https or http. I have to bounce it to get things working again.

Any idea what is wrong?

Edit: btw, I'm running Calibre 3.18.0 on Ubuntu 17.10.

Last edited by Naenyn; 03-07-2018 at 11:46 PM. Reason: Adding versions
Naenyn is offline   Reply With Quote
Advert
Old 03-08-2018, 12:41 AM   #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: 32,561
Karma: 9906320
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That should take care of it: https://github.com/kovidgoyal/calibr...f175fdad2a1384
kovidgoyal is offline   Reply With Quote
Old 03-08-2018, 12:43 AM   #3
Naenyn
Junior Member
Naenyn began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: none
Great! That was a speedy fix.

So do I just wait for the next build, 3.19.0?
Naenyn is offline   Reply With Quote
Old 03-09-2018, 01:35 AM   #4
Naenyn
Junior Member
Naenyn began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: none
Just wanted to follow up on this. The fix works! I can get in to my Calibre via https after having attempted via http.

Thanks again for the quick turnaround!
Naenyn is offline   Reply With Quote
Old 03-09-2018, 01:39 AM   #5
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: 32,561
Karma: 9906320
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You're welcome
kovidgoyal is offline   Reply With Quote
Old 03-18-2018, 03:57 PM   #6
Naenyn
Junior Member
Naenyn began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: none
A followup question to this. When I try to hit Calibre from within my LAN, it works fine from a browser, but from the reader app I'm using on my iPad, I get the following error in Calibre:

Code:
calibre server listening on :::18243:0:0
Unhandled exception in state: State: do_ssl_handshake Client: ::ffff:192.168.1.213:63445 Request: WebSocketConnection
Traceback (most recent call last):
  File "site-packages/calibre/srv/loop.py", line 569, in tick
  File "site-packages/calibre/srv/loop.py", line 177, in do_ssl_handshake
SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:590)
Any ideas?
Naenyn is offline   Reply With Quote
Old 03-18-2018, 04:59 PM   #7
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 1,344
Karma: 5400086
Join Date: Jun 2010
Device: Windows 10 tablet,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Naenyn View Post
A followup question to this. When I try to hit Calibre from within my LAN, it works fine from a browser, but from the reader app I'm using on my iPad, I get the following error in Calibre:

Code:
calibre server listening on :::18243:0:0
Unhandled exception in state: State: do_ssl_handshake Client: ::ffff:192.168.1.213:63445 Request: WebSocketConnection
Traceback (most recent call last):
  File "site-packages/calibre/srv/loop.py", line 569, in tick
  File "site-packages/calibre/srv/loop.py", line 177, in do_ssl_handshake
SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:590)
Any ideas?
In your app on the Ipad use /mobile after the port#

i.e. 192.168.1.2:8080/mobile

bernie

Last edited by gbm; 03-18-2018 at 05:03 PM. Reason: make mor clear
gbm is offline   Reply With Quote
Old 03-18-2018, 07:00 PM   #8
Naenyn
Junior Member
Naenyn began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: none
Quote:
Originally Posted by gbm View Post
In your app on the Ipad use /mobile after the port#

i.e. 192.168.1.2:8080/mobile

bernie
I appreciate the response. However, I don't believe this is the problem. My iPad app uses opds. If I disable SSL, I can hit calibre fine from the iPad app (WAN or LAN). If I enable SSL, I can hit calibre fine from a web browser at the appropriate url & port on both my LAN and WAN. However, the app I'm using errors and calibre complains in the log as I described above. At this point, I'm thinking that the app I'm using may not work properly with secure connections, but there's definitely a little weirdness in calibre, too (the unhandled exception).
Naenyn is offline   Reply With Quote
Old 03-18-2018, 07:20 PM   #9
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 1,344
Karma: 5400086
Join Date: Jun 2010
Device: Windows 10 tablet,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Naenyn View Post
I appreciate the response. However, I don't believe this is the problem. My iPad app uses opds. If I disable SSL, I can hit calibre fine from the iPad app (WAN or LAN). If I enable SSL, I can hit calibre fine from a web browser at the appropriate url & port on both my LAN and WAN. However, the app I'm using errors and calibre complains in the log as I described above. At this point, I'm thinking that the app I'm using may not work properly with secure connections, but there's definitely a little weirdness in calibre, too (the unhandled exception).
Your app does not support ssl, I have seen this in android reader apps--one worked with ssl, one did not. I was using a self sign cert.


bernie
gbm is offline   Reply With Quote
Old 03-18-2018, 07:25 PM   #10
Naenyn
Junior Member
Naenyn began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: none
Quote:
Originally Posted by gbm View Post
Your app does not support ssl, I have seen this in android reader apps--one worked with ssl, one did not. I was using a self sign cert.
Yep that's definitely the problem. I tried with a different app on my old android tablet and it works great. Emailed the developer of the iPad app to ask about SSL support.

In the meantime, I still think it'd be worth investigating that unhanded exception I posted about.
Naenyn is offline   Reply With Quote
Old 03-18-2018, 11:18 PM   #11
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: 32,561
Karma: 9906320
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The unhandled exception is perfectly normal, that's how error handling in the server works. The exception is logged and the connection closed.
kovidgoyal is offline   Reply With Quote
Old 03-18-2018, 11:32 PM   #12
Naenyn
Junior Member
Naenyn began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2018
Device: none
Fair enough, thanks for explaining! Glad there isn't another bug.

As a Java dev, I'm just used to catching/handling stuff like that. Was worried this was going unhandled, but sounds like you've got it under control.

Thanks!
Naenyn is offline   Reply With Quote
Old 03-18-2018, 11:47 PM   #13
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: 32,561
Karma: 9906320
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yeah the exception is caught in the server as well, it's just logged using a generic logging mechanism because I haven't bothered to special case the handling of that particular exception.
kovidgoyal is offline   Reply With Quote
Reply

Tags
ssl

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use SSL on Mac running Server paul55391 Devices 3 08-13-2017 10:18 PM
Calibre with SSL, Content Server not loading aCIDsLAM Calibre 15 06-26-2017 03:16 AM
calibre-server on vps alongside apache with ssl g33kdad Related Tools 2 01-01-2016 12:09 AM
[How To] Running Calibre server as a news server sws Related Tools 0 04-09-2013 08:27 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 06:08 PM


All times are GMT -4. The time now is 03:00 AM.


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