Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http2 Library #5

Open
MicaMikey opened this issue Jun 29, 2016 · 3 comments
Open

Http2 Library #5

MicaMikey opened this issue Jun 29, 2016 · 3 comments

Comments

@MicaMikey
Copy link

MicaMikey commented Jun 29, 2016

Hi,

I am testing the Http2 library and having issues with connecting to Apple. The issue is in the following line of code:

await sslStream.AuthenticateAsClientAsync(
ConnectionSettings.Host,
ConnectionSettings.Certificates ?? new X509CertificateCollection(),
System.Security.Authentication.SslProtocols.Tls12,
false).ConfigureAwait(false);
The Error message is "The message received was unexpected or badly formatted" and when I use wireshark and look at the packets received I see that there is a Handshake issue reported by apple failure 40.

I am quite certain that the p12 file I have created is fine because I can use it on gateway.push.apple.com with port 2195 and it works fine. I have checked the certificate and it is production cert that supports HTTP2 it has the right info in the cert itself such as Apple Push Services. I was wondering have you managed to run the HTTP2 code successful to connect to apple at all? I have even installed the GeoTrust Global CA cert and that didn't help. I can verify and connect to apple using openssl as long as GeoTrust Global CA is attached to the call.

I am torn between some sort of issue in the P12 file although I think it was created properly or the fact that .net isn't sending the certificate information properly to apple. I saw that ALPN wasn't supported by .net just yet!!!

Appreciate your help.

Regards,
mike

@Neio
Copy link

Neio commented Jul 13, 2017

I have experienced the same error sometimes. It auto recover after a few hours. It throws "The message received was unexpected or badly formatted" because underlying connection was reset.

Update:
Seems like Apple drops support of lesser secured cipher algorithm, and close the connection after client-hello TLS handshake.

@lzy-gogo
Copy link

lzy-gogo commented May 8, 2021

@Neio How did you deal with this problem? I also encountered this problem in win7 system, and I can communicate normally in win10 system.

@Neio
Copy link

Neio commented May 27, 2021

@lzy-gogo , in win7, I implemented a BouncyCastle layer to handle the TLS connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants