Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre Companion

Notices

Reply
 
Thread Tools Search this Thread
Old 04-25-2016, 10:21 AM   #1
RedArmy
Junior Member
RedArmy began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2016
Device: Pixel C
Getting Calibre-Companion to Work With SSL

Hello,

I have a calibre server set up to run on (let's say) dave.com. It runs a very standard service from the basic setup tutorial, runs on port 8080, and its also password protected. For SSL I use STunnel from port 44344 so that if someone goes to https://dave.com:44344 they get the username/password prompt and can log in and use the server via HTTPS.

I would like to also get calibre companion to work with SSL/HTTPS.

I can get it to connect properly using http on port 8080 using the following configuration:
Click image for larger version

Name:	Clipboard01.jpg
Views:	420
Size:	102.3 KB
ID:	148211

The issue is that nowhere in that configuration dialog can I find a setting for SSL, so as a result, I cannot figure out how to get it to recognize HTTPS, because this configuration:
Click image for larger version

Name:	Clipboard02.jpg
Views:	384
Size:	102.7 KB
ID:	148212

produces the following upon my attempts to connect:
Click image for larger version

Name:	Clipboard03.jpg
Views:	355
Size:	118.3 KB
ID:	148213

Any recommendations on how to make it work with SSL? Because I don't want to have to change my password after every time I connect over HTTP.

Last edited by chaley; 04-25-2016 at 10:41 AM.
RedArmy is offline   Reply With Quote
Old 04-25-2016, 11:02 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I took the liberty of turning your images into attachments. I couldn't read it as it was, and the post also violated forum rules.

Have you tried https://dave.com:44344/?

I use SSL with CC. My content server is set up behind apache. Apache handles authorization (user/password) and forwards requests to calibre using the rewrite rules described in calibre's manual. Since my apache server listens on the standard port 443 the url https://my.server.org/library works. However, I just tried https://my.server.org:443/library, which works as well. The URL https://my.server.org:444/library does not work, which demonstrates that the port in the URL is being respected.

This web page seems to describe what you want to do, use stunnel as an https proxy to connect to an http-only web server.

NB: CC doesn't do certificate management, so self-signed certs won't work. CC must be able to validate the cert with some known authority.
chaley is offline   Reply With Quote
Old 04-25-2016, 11:22 AM   #3
RedArmy
Junior Member
RedArmy began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2016
Device: Pixel C
Quote:
I took the liberty of turning your images into attachments. I couldn't read it as it was, and the post also violated forum rules.
Thank you, sorry about that.

I tried https://dave.com:44344/ and that had the same result. I am looking through this page: http://manual.calibre-ebook.com/server.html on how to integrate it with my apache server, in which case I wouldn't even need STunnel because my Apache uses Let's Encrypt certificates and forces HTTPS.

Crap... I just realized that Android has issues with LetsEncrypt certificates =/
RedArmy is offline   Reply With Quote
Old 04-25-2016, 12:51 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by RedArmy View Post
I tried https://dave.com:44344/ and that had the same result.
Did you check the "contains a full URL" box? I imagine you did or you wouldn't have been able to leave the port box empty.

Does that URL work from a web browser on the device? If it doesn't then it won't work with CC either. If it does work from a web browser then is should work from CC. Send me a debug log and perhaps I can tell what is going wrong.

If your stunnel is using letsencrypt then that might be the problem. There seems to be issues with the root cert.
chaley is offline   Reply With Quote
Old 04-25-2016, 06:47 PM   #5
RedArmy
Junior Member
RedArmy began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2016
Device: Pixel C
Quote:
Did you check the "contains a full URL" box? I imagine you did or you wouldn't have been able to leave the port box empty.
Yes, I did that.

Quote:
Does that URL work from a web browser on the device? If it doesn't then it won't work with CC either. If it does work from a web browser then is should work from CC. Send me a debug log and perhaps I can tell what is going wrong.
It works fine from the browser with just https://dave.com:44344

Quote:
If your stunnel is using letsencrypt then that might be the problem. There seems to be issues with the root cert.
Yeah its using letsencrypt... that's probably at the root of the issue =(

I attached the relevant section of the debug log. Thanks for taking the time to help out P:

debug_log.txt

Last edited by RedArmy; 04-25-2016 at 07:00 PM. Reason: added debug log
RedArmy is offline   Reply With Quote
Old 11-04-2016, 07:51 AM   #6
mobamoba
Enthusiast
mobamoba began at the beginning.
 
Posts: 38
Karma: 44
Join Date: Dec 2014
Device: Kobo Glo
Can this work for the Wireless Device Connection as well? I have SSL via Apache reverse proxy set up fine for the Content Server but can't figure out how to get it working for the Wireless Device Connection as well if even possible. Thanks.
mobamoba is offline   Reply With Quote
Old 11-04-2016, 08:33 AM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by mobamoba View Post
Can this work for the Wireless Device Connection as well? I have SSL via Apache reverse proxy set up fine for the Content Server but can't figure out how to get it working for the Wireless Device Connection as well if even possible. Thanks.
Sorry, the WD connection doesn't support SSL.
chaley is offline   Reply With Quote
Reply

Tags
calibre, calibre comanion, help request, help sought, ssl


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibre-server on vps alongside apache with ssl g33kdad Related Tools 2 01-01-2016 12:09 AM
Companion Does Not Work on Samsung 10.1 2013 estral Calibre Companion 4 06-14-2014 01:53 AM
Help! Can't get content server to work with Companion! ninjahsteve Calibre Companion 5 03-03-2014 03:21 AM
Calibre Companion: upcoming calibre 1.13 release forces full metadata send chaley Calibre Companion 3 12-04-2013 11:20 AM
Wrapping Calibre in SSL, Issue. Fmstrat Calibre 3 01-31-2012 10:29 PM


All times are GMT -4. The time now is 09:25 PM.


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