Python Forum

Full Version: Radicale server with SSL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Masters,

When IOS12 update installed on Iphone not sync anymore the contacts, and can't configure Cardav account on IPhone (without SSL?).

What i done already:
  • install python
  • installed new radicale
  • make config file (auth: htpasswd)
  • configure SSL (make certs..with openssl..)
  • On localhost i can log in to the web interface...

On my iphone try to configure CARDAV as the following:

> server: myserver.com
> user: admin
> pass:admin
> SSL
> Port: external port of the router (DSN-NAT to intranet)
> URL: https://myserver.com:EXTPORT/admin/

In the radicale configuration file i use the following:

[server]
SSL = True
certificate = c:/radicale/ssl/server_cert.pem
key = c:/radicale/ssl/server_key.pem
certificate_authority = c:/radicale/ssl/client_cert.pem
protocol = PROTOCOL_TLS
[auth]
type = http_x_remote_user
htpasswd_filename = c:/radicale/htpasswd.txt
htpasswd_encryption = plain
[rights]
file = c:/radicale/rights.txt

On the router i see the packages, and in the command window (radicale run in debug mode) i see the following when try to connect from phone:

Quote:C:\Users\holian>py -m radicale --config "c:\radicale\config" --debug
[76f0] INFO: Starting Radicale
[76f0] INFO: Authentication type is 'htpasswd'
[76f0] INFO: Storage type is 'multifilesystem'
[76f0] INFO: Rights type is 'from_file'
[76f0] INFO: Web type is 'internal'
[76f0] INFO: Listening to '127.0.0.1' on port 5234 using SSL
[76f0] INFO: Authentication type is 'htpasswd'
[76f0] INFO: Storage type is 'multifilesystem'
[76f0] INFO: Rights type is 'from_file'
[76f0] INFO: Web type is 'internal'
[76f0] INFO: Listening to 'holian-note.JSSPEED.LOCAL' on port 5234 using SSL
[76f0] INFO: Radicale server ready

[3148] ERROR: An exception occurred during request: SSL handshake failed: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1045)
Traceback (most recent call last):
File "C:\Users\holian\AppData\Local\Programs\Python\Python37-32\lib\site-packages\radicale\__init__.py", line 193, in process_request_thread
request.do_handshake()
File "C:\Users\holian\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", line 1108, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1045)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\holian\AppData\Local\Programs\Python\Python37-32\lib\site-packages\radicale\__init__.py", line 197, in process_request_thread
raise RuntimeError("SSL handshake failed: %s" % e) from e
RuntimeError: SSL handshake failed: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1045)

I really apperitiate any help how to make the connection work...

Regards
(Oct-09-2018, 06:44 PM)holian Wrote: [ -> ]certificate = c:/radicale/ssl/server_cert.pem
iPhones have a c:/ drive? Unless something's radically changed, I don't understand how that could work.

It looks like the new iphone version uses a new version of openssl, but radicale/python is using an old version. Have you tried running [iocde]pip install --upgrade radicale[/icode] to check for updates? I don't know what package manager the iphone uses, but there might be some flavor of apt/yum, and you could check for python-openssl updates?