2012-02-15 16 views
1

同じ認証局から発行されたクライアント認証証明書が2つあります。SSLハンドシェイクタイムアウト

HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(endPointUrl); 
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine); 
store.Open(OpenFlags.MaxAllowed); 
X509CertificateCollection col = (X509CertificateCollection)store.Certificates.Find(X509FindType.FindBySerialNumber, certificateSerialNumber, true); 
httpWebRequest.ClientCertificates.Add(col[0]); 
httpWebRequest.Method = "POST"; 
httpWebRequest.ContentType = contentType; 
httpWebRequest.KeepAlive = false; 
httpWebRequest.Timeout = 3000; 
httpWebRequest.ContentLength = message.Length; 
httpRequestStream = httpWebRequest.GetRequestStream(); 

要求ストリームを取得しようと、私は「メッセージでInvalidOperationExceptionが出る:そのうちの一つは、HTTPSのWebサービスに接続するために私を可能にしますが、私は次のようなコードを使用するときに、他にはありません操作がタイムアウトしました "。

証明書に接続しようとしたときにSystem.Net.traceを使用しましたが、ログに「ユーザー提供の証明書を使用してセッションを再試行しようとする」と最初のInitializeSecurityContextの直前に接続タイムアウトが表示されます。

Wiresharkのは、次のことを示しています

"TCP","j-link > https [SYN] Seq=0 Win=65535 Len=0 MSS=1260 SACK_PERM=1" 
"TCP","https > j-link [SYN, ACK] Seq=0 Ack=1 Win=32768 Len=0 MSS=1380" 
"TCP","j-link > https [ACK] Seq=1 Ack=1 Win=65535 Len=0" 
"TLSv1","Client Hello" 
"TLSv1","Server Hello" 
"TCP","[TCP segment of a reassembled PDU]" 
"TCP","j-link > https [ACK] Seq=78 Ack=2521 Win=65535 Len=0" 
"TLSv1","Certificate, Certificate Request, Server Hello Done" 
"TCP","j-link > https [ACK] Seq=78 Ack=3187 Win=64869 Len=0" 
"TCP","j-link > https [FIN, ACK] Seq=78 Ack=3187 Win=64869 Len=0" 
"TCP","https > j-link [ACK] Seq=3187 Ack=79 Win=32768 Len=0" 
"TLSv1","Alert (Level: Warning, Description: Close Notify)" 
"TCP","j-link > https [RST, ACK] Seq=79 Ack=3194 Win=0 Len=0" 

私はそれらをエクスポートし、PEM形式に変換した後、両方の証明書を使用して、コマンドラインからOpenSSLを使用して接続することができます。

ご意見をいただければ幸いです。

答えて

1

Shawn's questionありがとうございました。これは、接続が60秒以上失敗したために発生したタイムアウトの問題を解決するのに役立ちました。

「リクエストが中止されました:SSL/TLSセキュアチャネルを作成できませんでした」というメッセージが表示されました。エラーは、Windows HTTP Services Certificate Configuration Toolを使用して解決され、得られた情報はhereです。