C # Access HTTPS request aborted: Failed to create SSL/TLS secure channel (Could not-create SSL/TLS secure Channels)
General GetResponse can access HTTPS directly, if not add callback:
Servicepointmanager.servercertificatevalidationcallback = new System.Net.Security.RemoteCertificateValidationCallback (CheckValidationResult);
Not yet, added: Servicepointmanager.securityprotocol = SECURITYPROTOCOLTYPE.SSL3;
public string gethttpwebresponse (string url, string postdata, String code = "Utf-8") {Servic Epointmanager.securityprotocol = SECURITYPROTOCOLTYPE.SSL3; Servicepointmanager.servercertificatevalidationcallback = new System.Net.Security.RemoteCertificateValidationCallback (CheckValidationResult); HttpWebRequest request = (HttpWebRequest) httpwebrequest.create (URL); HttpWebResponse response = null; try {response = (HttpWebResponse) request. GetResponse (); using (StreamReader reader = new StreamReader (response. GetResponseStream (), encoding.getencoding (code)) {return reader. ReadToEnd (); }} catch (WebException e) {return e.message; The finally {if (response! = NULL) response. Close (); }} public static bool CheckvAlidationresult (object sender, X509Certificate certificate, X509chain chain, sslpolicyerrors errors) {R Eturn true; }
C # access to HTTPS failed to create SSL/TLS secure channel