0
我有一個Windows應用程序,它使得HTTP帖子發送和接收一些XML。在Windows PC上它可以正常工作,但是由於將其移動到測試服務器(Windows 2008 R2),裝入證書時出現「設備未準備好」錯誤。當使用X509證書發送http文章時,設備未準備好
該錯誤有點含糊,顯然搜索是一些相當模糊的結果。有沒有人遇到過這個?代碼在Dim證書中斷。...
證書已安裝並可導出。感謝任何建議。
Dim SendPropertyUri As String = "http://post.url"
Dim request As HttpWebRequest
Dim byteData() As Byte
Dim postStream As Stream = Nothing
request = DirectCast(WebRequest.Create(SendPropertyUri), HttpWebRequest)
Dim certificate As New X509Certificate("D:\Processor\certificates\mycert.p12", "password")
request.ClientCertificates.Add(certificate)
request.Method = "POST"
request.ContentType = "application/xml"
request.Accept = "application/xml"
byteData = UTF8Encoding.UTF8.GetBytes(foo.OuterXml)
request.ContentLength = byteData.Length
postStream = request.GetRequestStream()
postStream.Write(byteData, 0, byteData.Length)
postStream.Close()