Originally created by @nicolaspernoud on GitHub (Mar 10, 2019).
Hi,
Thanks for your amazing work.
I ran into the following issue : my mail server (https://github.com/mailcow/mailcow-dockerized) only allows TLS 1.2 when using ssl encryption with start tls.
It would seem bitwarden_rs doesn't manage to handshake with it.
Log :
[2019-03-10 13:08:56][_][INFO] Matched: POST /api/accounts/password-hint (password_hint)[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] connecting to *.*.*.*:587
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Read: 220 mail.*.* ESMTP Postcow<CRLF>
[2019-03-10 13:08:56][lettre::smtp][INFO] connection established to *.*.*.*:587
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Wrote: EHLO bc1a4c534636<CRLF>
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Read: 250-mail.*.*<CRLF>250-PIPELINING<CRLF>250-SIZE 104857600<CRLF>250-ETRN<CRLF>250-STARTTLS<CRLF>250-ENHANCEDSTATUSCODES<CRLF>250-8BITMIME<CRLF>250 DSN<CRLF>
[2019-03-10 13:08:56][lettre::smtp][DEBUG] server mail.*.* with {StartTls, EightBitMime}[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Wrote: STARTTLS<CRLF>
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Read: 220 2.0.0 Ready to start TLS<CRLF>
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Wrote: QUIT<CRLF>
[2019-03-10 13:08:56][bitwarden_rs::error][ERROR] Error sending email. handshake error
Could you do something about it ?
Thanks,
Best regards.
Originally created by @nicolaspernoud on GitHub (Mar 10, 2019).
Hi,
Thanks for your amazing work.
I ran into the following issue : my mail server (https://github.com/mailcow/mailcow-dockerized) only allows TLS 1.2 when using ssl encryption with start tls.
It would seem bitwarden_rs doesn't manage to handshake with it.
Log :
```bash
[2019-03-10 13:08:56][_][INFO] Matched: POST /api/accounts/password-hint (password_hint)
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] connecting to *.*.*.*:587
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Read: 220 mail.*.* ESMTP Postcow<CRLF>
[2019-03-10 13:08:56][lettre::smtp][INFO] connection established to *.*.*.*:587
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Wrote: EHLO bc1a4c534636<CRLF>
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Read: 250-mail.*.*<CRLF>250-PIPELINING<CRLF>250-SIZE 104857600<CRLF>250-ETRN<CRLF>250-STARTTLS<CRLF>250-ENHANCEDSTATUSCODES<CRLF>250-8BITMIME<CRLF>250 DSN<CRLF>
[2019-03-10 13:08:56][lettre::smtp][DEBUG] server mail.*.* with {StartTls, EightBitMime}
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Wrote: STARTTLS<CRLF>
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Read: 220 2.0.0 Ready to start TLS<CRLF>
[2019-03-10 13:08:56][lettre::smtp::client][DEBUG] Wrote: QUIT<CRLF>
[2019-03-10 13:08:56][bitwarden_rs::error][ERROR] Error sending email. handshake error
```
Could you do something about it ?
Thanks,
Best regards.
As far as I know, we only specify a minimum of TLS 1.1, but not a maximum, so it should work fine with TLS 1.2 as it is. I'm not sure why it wouldn't work.
@dani-garcia commented on GitHub (Mar 10, 2019):
As far as I know, we only specify a minimum of TLS 1.1, but not a maximum, so it should work fine with TLS 1.2 as it is. I'm not sure why it wouldn't work.
Anyway, this reminded me I needed to add an option to disable STARTTLS and instead use a normal TLS wrapped connection, so I've added that in https://github.com/dani-garcia/bitwarden_rs/commit/e93538cea959568292a7d37f49a9f6c2ad196a92. Maybe you can give that a try?
@nicolaspernoud commented on GitHub (Mar 11, 2019):
I tried the new image, whith -e SMTP_EXPLICIT_TLS=true and the outcome was the same :
[2019-03-11 09:44:10][_][INFO] Matched: POST /api/accounts/password-hint (password_hint)[2019-03-11 09:44:10][lettre::smtp::client][DEBUG] connecting to *.*.*.*:465
[2019-03-11 09:44:16][bitwarden_rs::error][ERROR] Error sending email. handshake error
The postfix log was the same : warning: TLS library problem: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca:../ssl/record/rec_layer_s3.c:1399:SSL alert number 48:
It would seems that mailcow accept connections with TLS less than 1.2 if a certificate is present, and since there is no certificate, the connection fails.
Maybe an option to force TLS version on bitwarden_rs could do the trick...
@nicolaspernoud commented on GitHub (Mar 11, 2019):
I tried the new image, whith `-e SMTP_EXPLICIT_TLS=true` and the outcome was the same :
```bash
[2019-03-11 09:44:10][_][INFO] Matched: POST /api/accounts/password-hint (password_hint)
[2019-03-11 09:44:10][lettre::smtp::client][DEBUG] connecting to *.*.*.*:465
[2019-03-11 09:44:16][bitwarden_rs::error][ERROR] Error sending email. handshake error
```
The postfix log was the same : `warning: TLS library problem: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca:../ssl/record/rec_layer_s3.c:1399:SSL alert number 48:`
It would seems that mailcow accept connections with TLS less than 1.2 if a certificate is present, and since there is no certificate, the connection fails.
Maybe an option to force TLS version on bitwarden_rs could do the trick...
That's interesting, on second thought, the tlsv1 alert unknown ca error seems unrelated to the TLS handshake. Is the certificate self signed? Can you check with another client if it's possible to connect?
@dani-garcia commented on GitHub (Mar 13, 2019):
That's interesting, on second thought, the `tlsv1 alert unknown ca` error seems unrelated to the TLS handshake. Is the certificate self signed? Can you check with another client if it's possible to connect?
The explicit TLS option at least helped me to solve my problem with sending mails from Bitwarden. So far there was always an unexpected error in the client when I wanted to send a master password hint and there was nothing in the log about it.
@kennymc-c commented on GitHub (Mar 14, 2019):
The explicit TLS option at least helped me to solve my problem with sending mails from Bitwarden. So far there was always an unexpected error in the client when I wanted to send a master password hint and there was nothing in the log about it.
@nicolaspernoud commented on GitHub (Mar 14, 2019):
It happens that my certificate was self signed (I use mailcow behind another auto let's encrypt reverse proxy so the web certificate was ok but not the one used by postfix). Replacing the certificate with the correct one works fine, with both port 587 + starttls or port 465 and the SMTP_EXPLICIT_TLS=true option.
Thanks a lot and kudos for your great work !
@nicolaspernoud commented on GitHub (Mar 14, 2019):
It happens that my certificate was self signed (I use mailcow behind another auto let's encrypt reverse proxy so the web certificate was ok but not the one used by postfix). Replacing the certificate with the correct one works fine, with both port 587 + starttls or port 465 and the `SMTP_EXPLICIT_TLS=true` option.
Thanks a lot and kudos for your great work !
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @nicolaspernoud on GitHub (Mar 10, 2019).
Hi,
Thanks for your amazing work.
I ran into the following issue : my mail server (https://github.com/mailcow/mailcow-dockerized) only allows TLS 1.2 when using ssl encryption with start tls.
It would seem bitwarden_rs doesn't manage to handshake with it.
Log :
Could you do something about it ?
Thanks,
Best regards.
@dani-garcia commented on GitHub (Mar 10, 2019):
As far as I know, we only specify a minimum of TLS 1.1, but not a maximum, so it should work fine with TLS 1.2 as it is. I'm not sure why it wouldn't work.
Anyway, this reminded me I needed to add an option to disable STARTTLS and instead use a normal TLS wrapped connection, so I've added that in https://github.com/dani-garcia/bitwarden_rs/commit/e93538cea959568292a7d37f49a9f6c2ad196a92. Maybe you can give that a try?
@nicolaspernoud commented on GitHub (Mar 10, 2019):
Thanks, I'll give it a try when the docker image will be updated.
In the meantime, for what it's worth, here's the postfix log when the connexion fails :
... and the postfix options regarding tls :
@nicolaspernoud commented on GitHub (Mar 11, 2019):
I tried the new image, whith
-e SMTP_EXPLICIT_TLS=trueand the outcome was the same :The postfix log was the same :
warning: TLS library problem: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca:../ssl/record/rec_layer_s3.c:1399:SSL alert number 48:It would seems that mailcow accept connections with TLS less than 1.2 if a certificate is present, and since there is no certificate, the connection fails.
Maybe an option to force TLS version on bitwarden_rs could do the trick...
@dani-garcia commented on GitHub (Mar 13, 2019):
That's interesting, on second thought, the
tlsv1 alert unknown caerror seems unrelated to the TLS handshake. Is the certificate self signed? Can you check with another client if it's possible to connect?@kennymc-c commented on GitHub (Mar 14, 2019):
The explicit TLS option at least helped me to solve my problem with sending mails from Bitwarden. So far there was always an unexpected error in the client when I wanted to send a master password hint and there was nothing in the log about it.
@nicolaspernoud commented on GitHub (Mar 14, 2019):
It happens that my certificate was self signed (I use mailcow behind another auto let's encrypt reverse proxy so the web certificate was ok but not the one used by postfix). Replacing the certificate with the correct one works fine, with both port 587 + starttls or port 465 and the
SMTP_EXPLICIT_TLS=trueoption.Thanks a lot and kudos for your great work !