# mTLS setup

**URL:** <https://forum.canton.network/t/mtls-setup/2637>\
**Category:** App Development\
**Tags:** ledger-api\
**Created:** [May 27, 2021, 1:22am UTC](https://forum.canton.network/t/mtls-setup/2637 "2021-05-27T01:22:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frankie](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/frankie/32/646_2.png) [@Frankie](https://forum.canton.network/u/Frankie)\
**Post date:** [May 27, 2021, 1:22am UTC](https://forum.canton.network/t/mtls-setup/2637/1 "2021-05-27T01:22:26Z")

</div>

I’m trying the mTLS configuration on the ledger. The Ledger API is set to use optional client mutual authentication. I got error messages when runing

> daml ledger list-parties --host 1.2.3.4 --tls --cacrt ca.crt

```
Listing parties at 1.2.3.4:6865
E0527 11:07:41.141000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:41.219000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:41.313000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:41.454000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:41.704000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:42.157000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:43.001000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:44.048000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:45.094000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0527 11:07:46.141000000 5708 external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.cc:1455] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
daml-helper: GRPCIOTimeout

```

Any clue?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [May 27, 2021, 7:23am UTC](https://forum.canton.network/t/mtls-setup/2637/2 "2021-05-27T07:23:40Z")

</div>

Hi @Frankie,  
I tried to reproduce this on SDK 1.13.1 with the following commands

```haskell
daml sandbox --cacrt ca.crt --crt server.crt --pem server.pem --client-auth optional
daml ledger list-parties --host localhost --port 6865 --cacrt ca.crt --tls

```

However, that works just fine for me.  
Are you running on a different SDK version?

---

<div class="post-metadata">

**Author:** ![Frankie](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/frankie/32/646_2.png) [@Frankie](https://forum.canton.network/u/Frankie)\
**Post date:** [May 27, 2021, 1:09pm UTC](https://forum.canton.network/t/mtls-setup/2637/3 "2021-05-27T13:09:19Z")

</div>

We got 1.11.1. Will try it with later version.

---

<div class="post-metadata">

**Author:** ![nycnewman](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nycnewman/32/15_2.png) [@nycnewman](https://forum.canton.network/u/nycnewman)\
**Post date:** [May 28, 2021, 4:11pm UTC](https://forum.canton.network/t/mtls-setup/2637/4 "2021-05-28T16:11:53Z")

</div>

You can also use commands like the following:

```haskell
openssl s_client -host <IP> -port 6865 -status -tlsextdebug -CAfile ca.cert.pem -cert client.cert.pem -certform PEM -key client.key.pem -keyform PEM -tls1_2

```

to validate that the server came up with mTLS enabled This should connect with TLS and return the server cert details.

---

<div class="post-metadata">

**Author:** ![quidagis](https://avatars.discourse-cdn.com/v4/letter/q/dbc845/32.png) [@quidagis](https://forum.canton.network/u/quidagis)\
**Post date:** [August 4, 2021, 2:46am UTC](https://forum.canton.network/t/mtls-setup/2637/5 "2021-08-04T02:46:38Z")

</div>

Thank you for that cmd, I’ll place that into my Testing Tools 👍🏻
