EPP域名系统的数据包格式
public static void RunClient(){
TcpClient client = new TcpClient("ote1.afilias.net", 700);
SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
X509CertificateCollection certs = new X509CertificateCollection();
X509Certificate cert = X509Certificate.CreateFromCertFile(@"D:\my.crt");
certs.Add(cert);
try
{
sslStream.AuthenticateAsClient("myserver", certs, SslProtocols.Tls, true);
}
catch (AuthenticationException e)
{
Console.WriteLine("Exception: {0}", e.Message);
if (e.InnerException != null)
{
Console.WriteLine("Inner exception: {0}", e.InnerException.Message);
}
Console.WriteLine("Authentication failed - closing the connection.");
return ;
}
XmlDocument xmld = new XmlDocument();
xmld.Load("login.xml");//加载xml文件
string msg=xmld.InnerXml;
byte[] messsage = Encoding.Default.GetBytes(msg);
//不明白的地方,请帮忙
//EPP数据包格式要求发送的包中 首先是一个32比特的无符号整数作为长度域,表示整个包的字节长度(包括长度域本身),接下来是XML格式的内容
//这边的代码要怎么写?
sslStream.Write(messsage);
sslStream.Flush();
}
补充:.NET技术 , C#