03-07-2018, 11:25 PM | #1 |
Member
Posts: 11
Karma: 10
Join Date: Mar 2018
Device: none
|
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) 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 |
03-08-2018, 12:41 AM | #2 |
creator of calibre
Posts: 44,323
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That should take care of it: https://github.com/kovidgoyal/calibr...f175fdad2a1384
|
Advert | |
|
03-08-2018, 12:43 AM | #3 |
Member
Posts: 11
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? |
03-09-2018, 01:35 AM | #4 |
Member
Posts: 11
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! |
03-09-2018, 01:39 AM | #5 |
creator of calibre
Posts: 44,323
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You're welcome
|
Advert | |
|
03-18-2018, 03:57 PM | #6 |
Member
Posts: 11
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) |
03-18-2018, 04:59 PM | #7 | |
Wizard
Posts: 2,115
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
i.e. 192.168.1.2:8080/mobile bernie Last edited by gbm; 03-18-2018 at 05:03 PM. Reason: make mor clear |
|
03-18-2018, 07:00 PM | #8 |
Member
Posts: 11
Karma: 10
Join Date: Mar 2018
Device: none
|
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).
|
03-18-2018, 07:20 PM | #9 | |
Wizard
Posts: 2,115
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
bernie |
|
03-18-2018, 07:25 PM | #10 | |
Member
Posts: 11
Karma: 10
Join Date: Mar 2018
Device: none
|
Quote:
In the meantime, I still think it'd be worth investigating that unhanded exception I posted about. |
|
03-18-2018, 11:18 PM | #11 |
creator of calibre
Posts: 44,323
Karma: 23661992
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.
|
03-18-2018, 11:32 PM | #12 |
Member
Posts: 11
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! |
03-18-2018, 11:47 PM | #13 |
creator of calibre
Posts: 44,323
Karma: 23661992
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.
|
Tags |
ssl |
|
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 |