質問

私は書く必要がある単純なプログラムのための作品は、以下の処理を行います:

  1. 読み込む設定ファイル
  2. 接続チサーバー
  3. 設立のsslソケット
  4. プル情報、サーバのx509certの有効期限は、現在のホスト名
  5. メールの報告が行われ

項目3-4などいっ研究/googleingと分かりませんjavaも、すべて1.2以降、2001年頃

役に立ちましたか?

解決 2

私は<のhref =「http://www.exampledepot.com/egs/javax.net.ssl/GetCert.html」のrel = "nofollowをでのJavaについて知っておくべきことを私に指示コードsnipitを見つけましたnoreferrer "> http://www.exampledepot.com/egs/javax.net.ssl/GetCert.html の

ここにある:

try {

    // Create the client socket
    int port = 443;
    String hostname = "hostname";
    SSLSocketFactory factory = HttpsURLConnection.getDefaultSSLSocketFactory();
    SSLSocket socket = (SSLSocket)factory.createSocket(hostname, port);

    // Connect to the server
    socket.startHandshake();

    // Retrieve the server's certificate chain
    java.security.cert.Certificate[] serverCerts =
        socket.getSession().getPeerCertificates();

    // Close the socket
    socket.close();
} catch (SSLPeerUnverifiedException e) {
} catch (IOException e) {
} catch (java.security.cert.CertificateEncodingException e) {   
}

他のヒント

A詳細なアガイドのinnersのJava暗号化拡張であることが明らかにされたOraclesして、ホームページ: http://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top