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

Problem with connection. Failed to establish SSL connection with the HTTP server #54

Open
xerasy opened this issue Jun 26, 2017 · 13 comments

Comments

@xerasy
Copy link

xerasy commented Jun 26, 2017

request.UserAgent = useragent;
request.IgnoreProtocolErrors = true;
request.SslCertificateValidatorCallback += (sender, certificate, chain, sslPolicyErrors) => true;

var result = request.Get("https://sscasino.online/");

but i get error
Failed to establish SSL connection with the HTTP server

i get the same the error for WebRequest

  WebRequest req = WebRequest.Create(Url);
  WebResponse resp = req.GetResponse();
  Stream stream = resp.GetResponseStream();
  StreamReader sr = new StreamReader(stream);
  string Out = sr.ReadToEnd();
  sr.Close();

but solution for WebRequest is a add line
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

what is the solution for xnet ?

@Fedorus
Copy link

Fedorus commented Feb 15, 2018

Looks like its a SslStream issue.
Put in on HttpRequests.cs on line ~2595
sslStream.AuthenticateAsClient(address.Host, null, SslProtocols.Tls12, false);

instead default line
sslStream.AuthenticateAsClient(...)

@ghost
Copy link

ghost commented Mar 1, 2018

Yes! you must set "request.SslCertificateValidatorCallback += delegate" return true

@angelocart
Copy link

Replacing the line sslStream.AuthenticateAsClient(...) with sslStream.AuthenticateAsClient(address.Host, null, SslProtocols.Tls12, false); returns an error of "SslProtocols' does not contain a definition for 'Tls12'.

Please fix, thanks!

@Fedorus
Copy link

Fedorus commented Jan 30, 2019

Replacing the line sslStream.AuthenticateAsClient(...) with sslStream.AuthenticateAsClient(address.Host, null, SslProtocols.Tls12, false); returns an error of "SslProtocols' does not contain a definition for 'Tls12'.

Please fix, thanks!

This repository no more supported. Try this one:
https://github.com/Fedorus/xNetStandard

Its for .netStandart. Lost all operations connected with winAPI plus GZip connections (some error with GZipStream in .net Core).

@angelocart
Copy link

Thank you for the response! I will let you know if any other errors occur.

Does the previous documentation for xNet apply to the new repository?

@Fedorus
Copy link

Fedorus commented Jan 30, 2019

Thank you for the response! I will let you know if any other errors occur.

Does the previous documentation for xNet apply to the new repository?

There was no breakink changes in API, but there may be bugs in fixes that I`ve described above

@angelocart
Copy link

Thank you for the response! I will let you know if any other errors occur.
Does the previous documentation for xNet apply to the new repository?

There was no breakink changes in API, but there may be bugs in fixes that I`ve described above

Okay. Thank you again for the quick reply.

@angelocart
Copy link

@Fedorus I use Visual Studio 2015. I cannot open the project files for xNetStandart so I cannot build the DLL file. Could you build the DLL and upload it?

@Fedorus
Copy link

Fedorus commented Jan 30, 2019

@Fedorus I use Visual Studio 2015. I cannot open the project files for xNetStandart so I cannot build the DLL file. Could you build the DLL and upload it?

here
xNetStandart.zip

@angelocart
Copy link

@Fedorus I use Visual Studio 2015. I cannot open the project files for xNetStandart so I cannot build the DLL file. Could you build the DLL and upload it?

here
xNetStandart.zip

Much appreciated. Have a good day!

@AnErrupTion
Copy link

This issue has been fixed with Better-xNet. https://github.com/AnErrupTion/Better-xNet @xerasy

@mathewsun
Copy link

Replacing the line sslStream.AuthenticateAsClient(...) with sslStream.AuthenticateAsClient(address.Host, null, SslProtocols.Tls12, false); returns an error of "SslProtocols' does not contain a definition for 'Tls12'.

Please fix, thanks!

sslStream.AuthenticateAsClient(address.Host, null, (SslProtocols)3072, true);

@SoheilMV
Copy link

This issue has been fixed with MVNet.
Supports TLS / SSL
https://github.com/SoheilMV/MVNet

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

6 participants