# OpenDHT Proxy with SSL/TLS

**URL:** <https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632>\
**Category:** Developers\
**Created:** [May 13, 2026, 5:46pm UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632 "2026-05-13T17:46:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonsai](https://forum.jami.net/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@bonsai](https://forum.jami.net/u/bonsai)\
**Post date:** [May 13, 2026, 5:46pm UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/1 "2026-05-13T17:46:32Z")

</div>

I’m currently running my own instance of opendht as proxy and coturn and try to find out how things work and to improve setup.

There I found that opendht --help shows an additional parameter called “–proxyserverssl” which however is not mentioned in the man page.

If this is designed to work similar to other TLS related services you would need a certificate and a private key. Looking at the source file “common\_tools.h” I found that the “long\_options” struct mentions the parameters “proxy-certificate” and “proxy-privkey” which seems to be exactly what I would have expected.

However I was not able to start opendht in proxy mode listening for tls/ssl.

What did I miss?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![aberaud](https://forum.jami.net/user_avatar/forum.jami.net/aberaud/32/35_2.png) [@aberaud](https://forum.jami.net/u/aberaud)\
**Post date:** [May 14, 2026, 6:48pm UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/2 "2026-05-14T18:48:17Z")

</div>

DHT proxies are regular web/http services, authenticated by Jami using regular certificate chains checked against the system certificate authorities (unlike peer-to-peer TLS connections between Jami users using pinned user certificates).

You should be able to start a dhtnode in proxy mode with TLS by using these 3 arguments:

`--proxy-certificate /path/to/certificate_chain.crt --proxy-privkey /path/to/private_key.key --proxyserverssl 443`

You would first need to obtain a certificate for your domain, for instance using let’s encrypt.

To use it in Jami, configure the DHT proxy as `https://your-proxy-url.example:443`  
You should also be able to test it with dhtnode by connecting to your proxy server as a dht proxy client with `dhtnode --proxyclient https://your-proxy-url.example:443 `.

If you encounter any problem, please open a ticket here:

> **[Issues · savoirfairelinux/opendht](https://github.com/savoirfairelinux/opendht/issues)**
>
> OpenDHT: a C++17 Distributed Hash Table implementation - Issues · savoirfairelinux/opendht

Good luck 🙂

---

<div class="post-metadata">

**Author:** ![bonsai](https://forum.jami.net/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@bonsai](https://forum.jami.net/u/bonsai)\
**Post date:** [May 15, 2026, 9:15am UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/3 "2026-05-15T09:15:08Z")

</div>

@aberaud

Thanks for your answer.

Yes that was exactly what I was trying without success. I will try again and see if I did anything wrong.

I would expect private key and certificate chain to be supplied in pem format and the certificates ordered from leaf to root. And the key to be not encrypted as there is not password needed.

---

<div class="post-metadata">

**Author:** ![bonsai](https://forum.jami.net/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@bonsai](https://forum.jami.net/u/bonsai)\
**Post date:** [May 15, 2026, 3:47pm UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/4 "2026-05-15T15:47:21Z")

</div>

Just rechecked it and it works as described and expected. No idea why it failed for the first time. Maybe I misinterpreted the log output which did not show a single line related to TLS if not in verbose mode.

Would be helpful for others if dhtnode functionality, usage message and man page would be in sync and mention these parameters.

Thanks again for your help!

---

<div class="post-metadata">

**Author:** ![bonsai](https://forum.jami.net/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@bonsai](https://forum.jami.net/u/bonsai)\
**Post date:** [May 16, 2026, 9:25am UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/5 "2026-05-16T09:25:48Z")

</div>

Nearly successful:

The proxy is running but I’m unable to connect to it with latest Jami QT Client (only one I checked so far)

When adding the prefix “https://” to the connection string I get the error “No network connection” from the client. In the proxy logs I can see multiple messages like:

```auto
prepare connection error: tlsv1 alert internal error (SSL routines)

```

TLS on the proxy itself is working properly. When connecting with openssl s\_client -connect

```auto
SSL handshake has read 4720 bytes and written 375 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 4096 bit
This TLS version forbids renegotiation.
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)

```

Any suggestions what could be wrong? Maybe the client is trying to connect with TLS v1 which is quite outdated and it is blocked by the server OS?

Thanks and kind Regards

---

<div class="post-metadata">

**Author:** ![bonsai](https://forum.jami.net/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@bonsai](https://forum.jami.net/u/bonsai)\
**Post date:** [May 16, 2026, 9:34am UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/6 "2026-05-16T09:34:32Z")

</div>

> [@bonsai](#):
>
> Maybe the client is trying to connect with TLS v1 which is quite outdated and it is blocked by the server OS?

Just rechecked myself by forcing openssl s\_client to connect to the server with -tls1 and it produces the same error logs when connecting with the Jami client, so it seems the Jami client is using TLS v1.

As it is not a good idea to enable TLS below 1.2 on a server today, the question is how to tell the JAMI client to at least use TLS 1.2.

---

<div class="post-metadata">

**Author:** ![bonsai](https://forum.jami.net/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@bonsai](https://forum.jami.net/u/bonsai)\
**Post date:** [May 16, 2026, 12:21pm UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/7 "2026-05-16T12:21:31Z")

</div>

> [@bonsai](#):
>
> so it seems the Jami client is using TLS v1.

Not sure if this is true or if these log messages are artefactual. At least from the server sources I found that beginning with opendht 3.7.1 the proxy server only accepts TLS 1.3 and not even TLS 1.2. So even no chance to overrule this by openSSL config.

```auto
- asio::ssl::context tls_context {asio::ssl::context::sslv3_server};
+ asio::ssl::context tls_context {asio::ssl::context::tlsv13_server};

```

---

<div class="post-metadata">

**Author:** ![bonsai](https://forum.jami.net/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@bonsai](https://forum.jami.net/u/bonsai)\
**Post date:** [May 16, 2026, 1:15pm UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/8 "2026-05-16T13:15:44Z")

</div>

My stupid:

To keep production server unchanged, I did further testing on a test system. Therefore I also copied the certificate where neither common name nor SAN of the certificate match the host name.

As the Jami client seems to do strict RFC 2818 compliance checking this failed on the test system.

It was the confusing log error message “tlsv1 alert internal error” leading me in the wrong direction. Additionally the fact that TLS test with “openssl s\_client -connect” succeeded flawlessly.

So at the end: Sorry for wasting bandwidth and your time 😒

---

<div class="post-metadata">

**Author:** ![aberaud](https://forum.jami.net/user_avatar/forum.jami.net/aberaud/32/35_2.png) [@aberaud](https://forum.jami.net/u/aberaud)\
**Post date:** [May 17, 2026, 7:34pm UTC](https://forum.jami.net/t/opendht-proxy-with-ssl-tls/5632/9 "2026-05-17T19:34:56Z")

</div>

No problem.  
It shows we need to improve the docs 🙂  
Please ask if you encounter any other issues.
