Bonjour,
As-tu trouvé une solution à ton problème ?
Je dois me connecter à un site en https avec un certificat et j'ai cette erreur :
La demande a été abandonnée : Impossible de créer un canal sécurisé SSL/TLS
Voici le Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
// Handle any certificate errors on the certificate from the server.
System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatesPolicy();
X509Certificate x509 = X509Certificate.CreateFromCertFile(@"C:\Tests\test.cer");
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://adresse...");
req.ClientCertificates.Add(x509);
req.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
req.Method = "POST";
req.ContentType ="application/x-www-form-urlencoded";
...
Stream postStream = req.GetRequestStream(); ---> BOOM BADABOUM |
Avez-vious une idée s'il vous plait ?
Merci
Partager