Open iojea opened 3 weeks ago
Sorry for the delay. Looks definitely like a TLS issue, but does not look obvious to me at first glance. When I compare with my logs:
2024-11-05T15:21:43.204043Z TRACE client::build: rustls::client::hs: Sending ClientHello Message {
version: TLSv1_0,
payload: Handshake {
parsed: HandshakeMessagePayload {
typ: ClientHello,
payload: ClientHello(
ClientHelloPayload {
client_version: TLSv1_2,
random: 8a2cb3625125cbe0fe7fcb83622aad0a8309c8b881492346c915a4da088c00a2,
session_id: 7686b848821d0d500a67ccc707c0be58f4ae79a142fb6965ebc9e9051007cc3b,
cipher_suites: [
TLS13_AES_256_GCM_SHA384,
TLS13_AES_128_GCM_SHA256,
TLS13_CHACHA20_POLY1305_SHA256,
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
],
compression_methods: [
Null,
],
extensions: [
PresharedKeyModes(
[
PSK_DHE_KE,
],
),
KeyShare(
[
KeyShareEntry {
group: X25519,
payload: 8e1b0bc03f2ed3c6b1ac776cc205e5b427cdaa000387bcabea59289d7b64183a,
},
],
),
ExtendedMasterSecretRequest,
ServerName(
[
ServerName {
typ: HostName,
payload: HostName(
DnsName(
"posteo.de",
),
),
},
],
),
SupportedVersions(
[
TLSv1_3,
TLSv1_2,
],
),
NamedGroups(
[
X25519,
secp256r1,
secp384r1,
],
),
CertificateStatusRequest(
Ocsp(
OcspCertificateStatusRequest {
responder_ids: [],
extensions: ,
},
),
),
Protocols(
[
ProtocolName(
696d6170,
),
],
),
SessionTicket(
Request,
),
SignatureAlgorithms(
[
ECDSA_NISTP384_SHA384,
ECDSA_NISTP256_SHA256,
ED25519,
RSA_PSS_SHA512,
RSA_PSS_SHA384,
RSA_PSS_SHA256,
RSA_PKCS1_SHA512,
RSA_PKCS1_SHA384,
RSA_PKCS1_SHA256,
],
),
EcPointFormats(
[
Uncompressed,
],
),
],
},
),
},
encoded: 010000ee03038a2cb3625125cbe0fe7fcb83622aad0a8309c8b881492346c915a4da088c00a2207686b848821d0d500a67ccc707c0be58f4ae79a142fb6965ebc9e9051007cc3b0014130213011303c02cc02bcca9c030c02fcca800ff01000091002d00020101003300260024001d00208e1b0bc03f2ed3c6b1ac776cc205e5b427cdaa000387bcabea59289d7b64183a001700000000000e000c000009706f7374656f2e6465002b00050403040303000a00080006001d0017001800050005010000000000100007000504696d617000230000000d00140012050304030807080608050804060105010401000b00020100,
},
}
2024-11-05T15:21:43.223142Z TRACE client::build: rustls::client::hs: Got HRR HelloRetryRequest { legacy_version: TLSv1_2, session_id: 7686b848821d0d500a67ccc707c0be58f4ae79a142fb6965ebc9e9051007cc3b, cipher_suite: TLS13_AES_256_GCM_SHA384, extensions: [SupportedVersions(TLSv1_3), KeyShare(secp384r1)] }
2024-11-05T15:21:43.226147Z TRACE client::build: rustls::client::hs: Sending ClientHello Message {
version: TLSv1_2,
payload: Handshake {
parsed: HandshakeMessagePayload {
typ: ClientHello,
payload: ClientHello(
ClientHelloPayload {
client_version: TLSv1_2,
random: 8a2cb3625125cbe0fe7fcb83622aad0a8309c8b881492346c915a4da088c00a2,
session_id: 7686b848821d0d500a67ccc707c0be58f4ae79a142fb6965ebc9e9051007cc3b,
cipher_suites: [
TLS13_AES_256_GCM_SHA384,
TLS13_AES_128_GCM_SHA256,
TLS13_CHACHA20_POLY1305_SHA256,
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
],
compression_methods: [
Null,
],
extensions: [
PresharedKeyModes(
[
PSK_DHE_KE,
],
),
KeyShare(
[
KeyShareEntry {
group: secp384r1,
payload: 04d07bff18162199be7cb2d7d7981064f36c06764b50689bc05e1e42d03ff05c9d29ab5b5b814e133084fc242e0413ad81dd317fe5405c2ae29027c2ae6dab8656e591d07999d13d2f87a70a885a997745d527d05b968cb1454259b72f80cf054a,
},
],
),
ExtendedMasterSecretRequest,
ServerName(
[
ServerName {
typ: HostName,
payload: HostName(
DnsName(
"posteo.de",
),
),
},
],
),
SupportedVersions(
[
TLSv1_3,
TLSv1_2,
],
),
NamedGroups(
[
X25519,
secp256r1,
secp384r1,
],
),
CertificateStatusRequest(
Ocsp(
OcspCertificateStatusRequest {
responder_ids: [],
extensions: ,
},
),
),
Protocols(
[
ProtocolName(
696d6170,
),
],
),
SessionTicket(
Request,
),
SignatureAlgorithms(
[
ECDSA_NISTP384_SHA384,
ECDSA_NISTP256_SHA256,
ED25519,
RSA_PSS_SHA512,
RSA_PSS_SHA384,
RSA_PSS_SHA256,
RSA_PKCS1_SHA512,
RSA_PKCS1_SHA384,
RSA_PKCS1_SHA256,
],
),
EcPointFormats(
[
Uncompressed,
],
),
],
},
),
},
encoded: 0100012f03038a2cb3625125cbe0fe7fcb83622aad0a8309c8b881492346c915a4da088c00a2207686b848821d0d500a67ccc707c0be58f4ae79a142fb6965ebc9e9051007cc3b0014130213011303c02cc02bcca9c030c02fcca800ff010000d2002d000201010033006700650018006104d07bff18162199be7cb2d7d7981064f36c06764b50689bc05e1e42d03ff05c9d29ab5b5b814e133084fc242e0413ad81dd317fe5405c2ae29027c2ae6dab8656e591d07999d13d2f87a70a885a997745d527d05b968cb1454259b72f80cf054a001700000000000e000c000009706f7374656f2e6465002b00050403040303000a00080006001d0017001800050005010000000000100007000504696d617000230000000d00140012050304030807080608050804060105010401000b00020100,
},
}
2024-11-05T15:21:43.226560Z TRACE client::build: rustls::conn: Dropping CCS
2024-11-05T15:21:43.253327Z TRACE client::build: rustls::client::hs: We got ServerHello ServerHelloPayload {
extensions: [
SupportedVersions(
TLSv1_3,
),
KeyShare(
KeyShareEntry {
group: secp384r1,
payload: 04e4e9c53dfc83202dcffd679cbf88b468c9b4743d96b21fc64da18153f3a9202e6040dca510efa13527bdd0242c3674b7b858637484910f2ec19608b8f3610971e6f38ca511b17d29934c1d443fee4f3cc61a4efa9967dbe532bbbc0c82c69141,
},
),
],
legacy_version: TLSv1_2,
random: 5b33236e7196b56beff305c9243278f217996d1d40c42e500c2fdbf2a653e35a,
session_id: 7686b848821d0d500a67ccc707c0be58f4ae79a142fb6965ebc9e9051007cc3b,
cipher_suite: TLS13_AES_256_GCM_SHA384,
compression_method: Null,
}
I notice that your server drops straight the ClientHello
message (due to TLS 1.0?), whereas my server sends a HelloRetryRequest
which allows me to try TLS 1.2. I will investigate and let you know.
Does your server support STARTTLS? If so, could you try?
PS: you can now download a pre-built binary from the CI, which prevents you to rebuild the project. This only work if you use default cargo features!
This is the full error: ConnectTls(Custom { kind: InvalidData, error: AlertReceived(HandshakeFailure) })
. I will open an issue to rustls
and seek for help.
To summarize: rustls
is not compatible with your server. I tried many other crypto providers and none worked. One went a bit further but still failed later on. The last think I could do is to try with OpenSSL, but I need to refactor to many things first. Let's keep this issue open till I finally capable of testing with OpenSSL.
Ok... Sad news.
Just two comments:
1) if I use start-tls in the config file, himalaya seems to enter a loop of something. Running himalaya --trace
I get:
2024-11-06T00:20:50.677849Z INFO himalaya::email::envelope::command::list: executing list envelopes command
2024-11-06T00:20:50.679704Z DEBUG email::imap: building 1 IMAP clients
And nothing else happens. It looks like it is trying to build the IMAP client for ever.
2) The server is supposed to be compatible with TLS 1.2
3) Some time ago I tried meli-email, and I was able to configure it and access my mail. I don't know if meli uses rustls.
Thanks for checking this out!
- if I use start-tls in the config file, himalaya seems to enter a loop of something.
It basically means that the server does not support STARTTLS as well. Although he infinite loop is strange, I will check if there is not an issue with the retry algorithm
The server is supposed to be compatible with TLS 1.2
After investigation from Rustls, it's not a TLS version issue but more a ciphersuites one. Your server seems to only support an old, insecure algorithm (DHE) that is purposefully not handled by Rustls.
Some time ago I tried meli-email, and I was able to configure it and access my mail. I don't know if meli uses rustls.
If I do not mistake, meli only supports native-tls. Good news: it confirm the fact that Himalaya would work with native-tls. Bad news: we are still far from supporting it, yet it's at the top priority. Here a mini-roadmap of what is missing:
TcpStream
and TlsStream
. I am still prototyping it, so it may change. The idea behind is to use a common enum TcpStream
or TlsStream
supporting different backends, including Rustls and OpenSSL (via Native TLS).Stay tuned! I will update this issue every time a new step is done.
Hi,
Since you are testing v1.0.0 I am coming back with this issue. Today I was able to build the master branch from source (something that had failed in all my previous attempts). But I am still unable to access my university account. My config.toml looks like this:
When I run
himalaya
I am asked for my pass password, and when I type it I get the following error. This has not changed with respect to v0.9.0.The output of
himalaya --debug
is:The output of
himalaya --trace
is:I don´t know what causes this issue, but I have successfully configured other mail clients with essentially the same config. I hope this can be fixed... Thanks!