|
|
От: |
_SaNNy_
|
|
| Дата: | 29.05.06 04:29 | ||
| Оценка: | |||
_>WebClient wc = new WebClient();
_>NameValueCollection parms = new NameValueCollection();
_>parms.Add("MMObjectType", "0");
_>parms.Add("MMObjectID", "");
_>parms.Add("To", number);
_>parms.Add("Msg", message);
_>parms.Add("Lang", "2");
_>wc.Headers.Add("Content-type", "application/x-www-form-urlencoded");
_>wc.UploadValues(Url, "POST", parms);
_>_>System.Net Information: 0 : [2208] SecureChannel#10261382 — Remote certificate has errors:
_>System.Net Information: 0 : [2208] SecureChannel#10261382 — Unknown error.
_>System.Net Information: 0 : [2208] SecureChannel#10261382 — Remote certificate was verified as invalid by the user.
_>System.Net Error: 0 : [2208] Exception in the HttpWebRequest#45523402:: — The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
_>System.Net Error: 0 : [2208] Exception in the HttpWebRequest#45523402::EndGetRequestStream — The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography.X509Certificates;
namespace mynamespace
{
class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
{
public TrustAllCertificatePolicy() {}
public bool CheckValidationResult(System.Net.ServicePoint sp, X509Certificate cert,System.Net.WebRequest req, int problem) { return true; }
}
}