SSL Certificat #27

Closed
opened 2026-10-05 06:02:37 +02:00 by adam · 1 comment
Owner

"Activating SSL is not working. I created a certificate using Certbot. Below you can see where everything was saved.

In the config.ini, I have entered the following:"

-------------------------

Server Configuration

-------------------------

[server]

The address to bind the server to. Use * to listen on all interfaces.

bind = 87.106.81.214

Port to run the web server on.

port = 443

Path to TLS certificate (leave blank to disable HTTPS).

tls_cert = /etc/letsencrypt/live/meshview.ddnsfree.com/fullchain.pem

Path for the ACME challenge if using Let's Encrypt.

acme_challenge =

-------------------------

Site Appearance & Behavior

-------------------------

[site]

The domain name of your site.

domain = meshview.ddnsfree.com


Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/meshview.ddnsfree.com/fullchain.p em
Key is saved at: /etc/letsencrypt/live/meshview.ddnsfree.com/privkey.pem
This certificate expires on 2026-02-04.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in t he background.

"When starting main.py, the following error message appears:"

./env/bin/python main.py

  • Exception Group Traceback (most recent call last):
    | File "/opt/meshview/main.py", line 12, in
    | asyncio.run(main())
    | File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    | return runner.run(main)
    | ^^^^^^^^^^^^^^^^
    | File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    | return self._loop.run_until_complete(task)
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    | return future.result()
    | ^^^^^^^^^^^^^^^
    | File "/opt/meshview/main.py", line 7, in main
    | async with asyncio.TaskGroup() as tg:
    | File "/usr/lib/python3.12/asyncio/taskgroups.py", line 145, in aexit
    | raise me from None
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    | File "/opt/meshview/meshview/web.py", line 1782, in run_server
    | ssl_context.load_cert_chain(CONFIG["server"]["tls_cert"])
    | ssl.SSLError: [SSL] PEM lib (_ssl.c:3916)
    +------------------------------------
"Activating SSL is not working. I created a certificate using Certbot. Below you can see where everything was saved. In the config.ini, I have entered the following:" # ------------------------- # Server Configuration # ------------------------- [server] # The address to bind the server to. Use * to listen on all interfaces. bind = 87.106.81.214 # Port to run the web server on. port = 443 # Path to TLS certificate (leave blank to disable HTTPS). tls_cert = /etc/letsencrypt/live/meshview.ddnsfree.com/fullchain.pem # Path for the ACME challenge if using Let's Encrypt. acme_challenge = # ------------------------- # Site Appearance & Behavior # ------------------------- [site] # The domain name of your site. domain = meshview.ddnsfree.com ------------------------------------------------------------------ Successfully received certificate. Certificate is saved at: **/etc/letsencrypt/live/meshview.ddnsfree.com/fullchain.p em** Key is saved at: /etc/letsencrypt/live/meshview.ddnsfree.com/privkey.pem This certificate expires on 2026-02-04. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in t he background. ------------------------------------------------------------------------------ "When starting main.py, the following error message appears:" ./env/bin/python main.py + Exception Group Traceback (most recent call last): | File "/opt/meshview/main.py", line 12, in <module> | asyncio.run(main()) | File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run | return runner.run(main) | ^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run | return self._loop.run_until_complete(task) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete | return future.result() | ^^^^^^^^^^^^^^^ | File "/opt/meshview/main.py", line 7, in main | async with asyncio.TaskGroup() as tg: | File "/usr/lib/python3.12/asyncio/taskgroups.py", line 145, in __aexit__ | raise me from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/opt/meshview/meshview/web.py", line 1782, in run_server | ssl_context.load_cert_chain(CONFIG["server"]["tls_cert"]) | ssl.SSLError: [SSL] PEM lib (_ssl.c:3916) +------------------------------------ <!-- github-sync-id:3595363662 -->
adam closed this issue 2026-10-05 06:02:37 +02:00
Author
Owner

I’ve found the fix!
The problem occurs because the application expects both the certificate and the private key to be in a single PEM file.
Certbot, however, generates them separately — as fullchain.pem and privkey.pem.

You can solve this by combining both files into one, for example:

sudo bash -c 'cat /etc/letsencrypt/live/meshview.ddnsfree.com/fullchain.pem
/etc/letsencrypt/live/meshview.ddnsfree.com/privkey.pem \

/etc/letsencrypt/live/meshview.ddnsfree.com/combined.pem'

Then, in your configuration file (e.g., config.ini), set:

[server]
tls_cert = /etc/letsencrypt/live/meshview.ddnsfree.com/combined.pem
port = 443

After restarting the server, HTTPS should work correctly.

I’ve found the fix! The problem occurs because the application expects both the certificate and the private key to be in a single PEM file. Certbot, however, generates them separately — as fullchain.pem and privkey.pem. You can solve this by combining both files into one, for example: sudo bash -c 'cat /etc/letsencrypt/live/meshview.ddnsfree.com/fullchain.pem \ /etc/letsencrypt/live/meshview.ddnsfree.com/privkey.pem \ > /etc/letsencrypt/live/meshview.ddnsfree.com/combined.pem' Then, in your configuration file (e.g., config.ini), set: [server] tls_cert = /etc/letsencrypt/live/meshview.ddnsfree.com/combined.pem port = 443 After restarting the server, HTTPS should work correctly. <!-- github-comment-id:3506443312 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/meshview#27