{"id":316,"date":"2014-09-18T04:39:54","date_gmt":"2014-09-17T19:39:54","guid":{"rendered":"http:\/\/www.dracula.mydns.jp\/blog\/?p=316"},"modified":"2022-12-07T18:47:09","modified_gmt":"2022-12-07T09:47:09","slug":"java%e3%81%a7https%e9%80%9a%e4%bf%a1%e3%81%ae%e5%ae%9f%e8%a3%85%e3%82%92%e3%81%99%e3%82%8b%e3%81%a8%e3%81%84%e3%81%86%e8%a8%98%e4%ba%8b%e3%82%92%e9%81%a9%e5%bd%93%e3%81%ab%e6%9b%b8%e3%81%8f%e3%81%ae","status":"publish","type":"post","link":"https:\/\/www.dracula.mydns.jp\/blog\/?p=316","title":{"rendered":"java\u3067HTTPS\u901a\u4fe1\u306e\u5b9f\u88c5\u3092\u3059\u308b\u3068\u3044\u3046\u8a18\u4e8b\u3092\u9069\u5f53\u306b\u66f8\u304f\u306e\u306f\u3084\u3081\u308b\u3079\u304d"},"content":{"rendered":"<p>\u3044\u308d\u3093\u306a\u30d6\u30ed\u30b0\u3067java\u3092\u4f7f\u3063\u305fHTTPS\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5b9f\u88c5\u306b\u3064\u3044\u3066\u66f8\u304b\u308c\u3066\u3044\u308b\u3002<br \/>\n\u3060\u304c\u9069\u5f53\u306a\u8a18\u4e8b\u304c\u591a\u3059\u304e\u3066\u56f0\u308b\u3002RFC\u3092\u8aad\u3093\u3067\u3044\u308b\u306e\u304b\u7591\u554f\u306b\u601d\u3046\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3060\u3002\u3068\u3044\u3046\u304bRFC\u306e\u5b58\u5728\u3092\u77e5\u3089\u306a\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<p>\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u30ea\u30f3\u30af\u306f\u57fa\u672c\u7684\u306b\u5f35\u3089\u306a\u3044\u3053\u3068\u306b\u3057\u3066\u3044\u308b\u304c\u7279\u5225\u306b\u5f35\u3063\u3066\u304a\u3053\u3046\u3002<br \/>\n<del>\u3053\u3061\u3089\u306fIPA\u304c\u63d0\u4f9b\u3057\u3066\u304f\u308c\u3066\u3044\u308bHTTP \u30aa\u30fc\u30d0\u30fc TLS\u3092\u898f\u5b9a\u3057\u305fRFC2818\u306e\u548c\u8a33\u3067\u3042\u308b\u3002<\/del><br \/>\n<a href=\"http:\/\/www.ipa.go.jp\/security\/rfc\/RFC2818JA.html#31\"><del>http:\/\/www.ipa.go.jp\/security\/rfc\/RFC2818JA.html#31<\/del><\/a><br \/>\n\u3053\u3061\u3089\u306fRFC9110\u306e\u65e5\u672c\u8a9e\u8a33\u3067\u3042\u308b\u3002(RFC9110\u306fRFC2818\u306e\u4fee\u6b63\u7248)<br \/>\n<a href=\"https:\/\/tex2e.github.io\/rfc-translater\/html\/rfc9110.html\">https:\/\/tex2e.github.io\/rfc-translater\/html\/rfc9110.html<\/a><\/p>\n<p>java\u306f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30e9\u30a4\u30d6\u30e9\u30ea\u3092JSSE\u3068\u3057\u3066\u30b3\u30a2\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u5206\u96e2\u3059\u308b\u3053\u3068\u3067\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd\u3092\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306b\u3088\u308b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u53ef\u80fd\u3068\u306a\u308b\u3088\u3046\u306a\u601d\u60f3\u3067\u8a2d\u8a08\u3055\u308c\u3066\u3044\u308b\u3002\u305d\u306e\u305f\u3081SSL\/TLS\u306b\u3064\u3044\u3066\u3082\u67d4\u8edf\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u53ef\u80fd\u3067\u3042\u308b\u3002<\/p>\n<p>\u9006\u306b\u8a00\u3046\u3068\u3057\u3063\u304b\u308a\u3068\u7406\u89e3\u3057\u3066\u3044\u306a\u3044\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30db\u30fc\u30eb\u3092\u4f5c\u308a\u3053\u3093\u3067\u3057\u307e\u3046\u3053\u3068\u306b\u306a\u308b\u3002\u4e16\u306e\u30d6\u30ed\u30b0\u306f\u3053\u308c\u306b\u8a72\u5f53\u3057\u3066\u3057\u307e\u3046\u8a18\u4e8b\u304c\u7570\u5e38\u306b\u591a\u3044\u3002\u3055\u3089\u306b\u60aa\u3044\u306e\u306f\u305d\u308c\u304c\u6b63\u89e3\u3067\u3042\u308b\u304b\u306e\u3088\u3046\u306b\u5e83\u304c\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3053\u3068\u3060\u3002<br \/>\n\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u4e2d\u306b\u3082\u305d\u3046\u3044\u3063\u305f\u30d6\u30ed\u30b0\u306e\u8a18\u4e8b\u304c\u6b63\u89e3\u3060\u3068\u601d\u3063\u3066\u3044\u308b\u4eba\u304c\u601d\u3044\u306e\u307b\u304b\u591a\u3044\u3068\u3044\u3046\u4e8b\u5b9f\u304c\u3042\u3063\u3066\u306f\u7b11\u3063\u3066\u3082\u3044\u3089\u308c\u306a\u3044\u3002<\/p>\n<p>\u3088\u304f\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308bHTTPS\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5b9f\u88c5\u306f\u3053\u3046\u3067\u3042\u308b\u3002<\/p>\n<pre><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nTrustManager&#x5B;] tm = {\n      new X509TrustManager() {\n           public X509Certificate&#x5B;] getAcceptedIssuers() {\n               return null;\n           }\n           public void checkClientTrusted(X509Certificate&#x5B;] xc,String type) {\n           }\n           public void checkServerTrusted(X509Certificate&#x5B;] xc,String type) {\n           }\n     }\n};\nSSLContext ctx = SSLContext.getInstance(&quot;TLS&quot;);\nctx.init(null, tm, new SecureRandom());\n\nURL url = new URL(&quot;https:\/\/hogehoge\/foo\/bar&quot;);\nHttpsURLConnection conn = (HttpsURLConnection)url.openConnection();\nconn.setDefaultHostnameVerifier(new HostnameVerifier() {\n      public boolean verify(String hostname, SSLSession session) {return true;}\n    }\n);\n\n  \u4ee5\u4e0b\u7565\n<\/pre>\n<p>\u307e\u3042\u901a\u4fe1\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002\u3057\u304b\u3057\u3053\u308c\u306f\u3084\u308b\u3079\u304d\u3053\u3068\u3092\u5168\u304f\u3084\u3063\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u3053\u306e\u30b3\u30fc\u30c9\u306b\u306f\u7c21\u5358\u306b\u4ee5\u4e0b\u306e\uff12\u3064\u306e\u554f\u984c\u304c\u3042\u308b\u3002<\/p>\n<ul>\n<li>\u8a3c\u660e\u66f8\u304c\u4fe1\u983c\u3067\u304d\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044\u30c8\u30e9\u30b9\u30c8\u30de\u30cd\u30fc\u30b8\u30e3\u3092\u7121\u6761\u4ef6\u3067\u4f7f\u3063\u3066\u3044\u308b\uff08\uff11\uff5e\uff11\uff13\u884c\u76ee\uff09<\/li>\n<li>\u30b5\u30fc\u30d0\u540d\u306e\u691c\u8a3c\u3092\u7121\u6761\u4ef6\u3067OK\u306b\u3057\u3066\u3044\u308b\uff08\uff11\uff17\uff5e\uff12\uff10\u884c\u76ee\uff09<\/li>\n<\/ul>\n<p>\uff11\u70b9\u76ee\u306e\u554f\u984c\u3067\u306f\u3001\u8a3c\u660e\u66f8\u304c\u9001\u3089\u308c\u3066\u304d\u3055\u3048\u3059\u308c\u3070\u305d\u308c\u304c\u507d\u9020\u3055\u308c\u305f\u3082\u306e\u3067\u3042\u308d\u3046\u3068\u4f55\u3060\u308d\u3046\u3068\u901a\u4fe1OK\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3002<br \/>\n\uff12\u70b9\u76ee\u306e\u554f\u984c\u3067\u306f\u3001\u4fe1\u983c\u3067\u304d\u308b\u8a8d\u8a3c\u5c40\u304b\u3089\u767a\u884c\u3055\u308c\u305f\u8a3c\u660e\u66f8\u3067\u3042\u308a\u3055\u3048\u3059\u308c\u3070\u305d\u308c\u304c\u76ee\u7684\u306e\u30b5\u30fc\u30d0\u306e\u3082\u306e\u3067\u306a\u304f\u3066\u3082\u901a\u4fe1OK\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3002<\/p>\n<p>\uff11\u70b9\u76ee\u306e\u507d\u9020\u8a3c\u660e\u66f8\u306bOK\u3092\u51fa\u3059\u306e\u304c\u30c0\u30e1\u306a\u3053\u3068\u306f\u76f4\u611f\u7684\u306b\u3082\u5206\u304b\u308b\u3067\u3057\u3087\u3046\u3002<br \/>\n\u3067\u306f\u3001\uff12\u70b9\u76ee\u306f\u306a\u305c\u30c0\u30e1\u306a\u306e\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u3053\u3093\u306a\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3002<\/p>\n<blockquote><p>\u4e0a\u8a18\u306e\u3088\u3046\u306a\u5b9f\u88c5\u3092\u3055\u308c\u305f\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u3067\u3042\u306a\u305f\u304c\u9280\u884c\u306e\u30b5\u30a4\u30c8\u306b\u63a5\u7d9a\u3057\u305f\u3064\u3082\u308a\u3067\u3044\u307e\u3059\u3002<br \/>\n\u3057\u304b\u3057\u3001\u3042\u306a\u305f\u304c\u4f7f\u3063\u3066\u3044\u308bDNS\u304c\u30ec\u30b3\u30fc\u30c9\u66f8\u304d\u63db\u3048\u306e\u653b\u6483\u3092\u53d7\u3051\u3066\u304a\u308a\u5b9f\u969b\u306b\u306f\u5225\u306e\u30b5\u30a4\u30c8(\u653b\u6483\u8005\u304c\u7ba1\u7406\u3059\u308b\u30b5\u30a4\u30c8\uff09\u306b\u7e4b\u304c\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<br \/>\n\u3067\u3059\u304c\u3001\u305d\u306e\u30b5\u30fc\u30d0\u306b\u306f\u7b2c\u4e09\u8005\u6a5f\u95a2\u304b\u3089\u767a\u884c\u3055\u308c\u305f\u8a3c\u660e\u66f8\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u30d6\u30e9\u30a6\u30b6\u306f\u901a\u4fe1\u76f8\u624b\u306f\u671f\u5f85\u3057\u305f\u30b5\u30fc\u30d0\u3067\u3042\u308b\u3068\u5224\u65ad\u3057\u3066\u901a\u4fe1\u3092\u7d9a\u884c\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u3042\u306a\u305f\u306f\u9280\u884c\u306e\u30b5\u30a4\u30c8\u3060\u3068\u601d\u3063\u3066ID\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u653b\u6483\u8005\u306f\u3042\u306a\u305f\u306eID\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u307e\u3093\u307e\u3068\u624b\u306b\u5165\u308c\u3066\u3057\u307e\u3046\u308f\u3051\u3067\u3059\u3002<\/p><\/blockquote>\n<p>\u672c\u6765\u306f\u507d\u306e\u30b5\u30fc\u30d0\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u8a3c\u660e\u66f8\u306e\u30b5\u30fc\u30d0\u540d\u3068\u3042\u306a\u305f\u304c\u63a5\u7d9a\u3057\u3088\u3046\u3068\u3057\u305f\u30b5\u30fc\u30d0\u540d\u306f\u7570\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u63a5\u7d9a\u306f\u62d2\u5426\u3055\u308c\u308b\u3079\u304d\u3067\u3042\u308b\u3002\u3067\u3059\u304c\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3053\u308c\u304c\u306a\u3055\u308c\u307e\u305b\u3093\u3002\u3055\u3089\u306b\u60aa\u3044\u3053\u3068\u306b\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u7121\u6761\u4ef6\u3067\u51e6\u7406\u304c\u3055\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u30e6\u30fc\u30b6\u304c\u305d\u3093\u306a\u3053\u3068\u304c\u8d77\u3053\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u77e5\u308b\u8853\u3082\u306a\u3044\u3002<\/p>\n<p>\u3067\u306f\u6b63\u3057\u304f\u51e6\u7406\u3059\u308b\u306b\u306f\u3069\u3046\u5b9f\u88c5\u3057\u305f\u3089\u3088\u3044\u306e\u3060\u308d\u3046\u304b\u3002\u3053\u3046\u3067\u3059\u3002<\/p>\n<pre><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nURL url = new URL(&quot;https:\/\/hogehoge\/foo\/bar&quot;);\nHttpsURLConnection conn = (HttpsURLConnection)url.openConnection();\n\u4ee5\u4e0b\u7565\n<\/pre>\n<p>\u975e\u5e38\u306b\u7c21\u5358\u3067\u3059\u3002\u306a\u3093\u306e\u3053\u3068\u306f\u306a\u3044\u3002java\u306f\u7279\u306b\u8a2d\u5b9a\u3092\u5909\u3048\u306a\u3044\u9650\u308a\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6b63\u3057\u304f\u52d5\u4f5c\u3092\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002<br \/>\n\u7121\u7406\u3084\u308a\u305d\u306e\u52d5\u4f5c\u3092\u6b6a\u3081\u3066\u3057\u307e\u3046\u5fc5\u8981\u306f\u306a\u3044\u306e\u3067\u3042\u308b\u3002<\/p>\n<p>\u81ea\u5df1\u7f72\u540d\u8a3c\u660e\u66f8\u3092\u8a2d\u5b9a\u3057\u305f\u30b5\u30fc\u30d0\u306b\u5bfe\u3057\u3066\u306f\u3053\u306e\u307e\u307e\u3067\u901a\u4fe1\u3092\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u901a\u4fe1\u306f\u3067\u304d\u306a\u3044\u3002<br \/>\n\u305d\u308c\u306f\u5f53\u7136\u3067\u3042\u308b\u3002\u306a\u305c\u306a\u3089\u81ea\u5df1\u7f72\u540d\u8a3c\u660e\u66f8\u306f\u4fe1\u7528\u3067\u304d\u308b\u8a3c\u660e\u66f8\u3067\u306f\u306a\u3044\u304b\u3089\u3060\u3002<br \/>\n\u3069\u3046\u306b\u3082\u306a\u3089\u306a\u3044\u306e\u304b\u3068\u3044\u3048\u3070\u305d\u3093\u306a\u3053\u3068\u306f\u306a\u3044\u3002<\/p>\n<p>\u81ea\u5df1\u7f72\u540d\u8a3c\u660e\u66f8\u3092\u4fe1\u7528\u3067\u304d\u308b\u3068\u3044\u3046\u524d\u63d0\u3067\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u30c8\u30e9\u30b9\u30c8\u30b9\u30c8\u30a2\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308c\u3070\u3088\u3044\u306e\u3060\u3002<br \/>\n\u3053\u308c\u306b\u3088\u308a\u901a\u4fe1\u306f\u53ef\u80fd\u306b\u306a\u308b\u3002<br \/>\n\u305f\u3060\u3001\u3053\u308c\u306f\u3042\u304f\u307e\u3067\u666e\u901a\u306e\u884c\u70ba\u3067\u306f\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3092\u8a8d\u8b58\u3057\u305f\u3046\u3048\u3067\u884c\u3046\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u306f\u304b\u304f\u3082\u9762\u5012\u304f\u3055\u3044\u3053\u3068\u3067\u3042\u308b\u304c\u3001\u3053\u3046\u3044\u3063\u305f\u3053\u3068\u304c\u5b88\u3089\u308c\u3066\u3088\u3046\u3084\u304f\u5b9f\u7528\u30ec\u30d9\u30eb\u306e\u5b89\u5168\u6027\u3092\u3082\u3063\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u3044\u3046\u306e\u304c\u5b9f\u73fe\u3067\u304d\u308b\u306e\u3067\u3042\u308b\u3002\u5b88\u3089\u308c\u3066\u3044\u3066\u3082\u30af\u30e9\u30c3\u30ab\u30fc\u3068\u306f\u30a4\u30bf\u30c1\u3054\u3063\u3053\u3067\u3042\u308b\u306e\u306b\u5b88\u3089\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306b\u5b89\u5168\u3067\u3042\u308b\u306a\u3069\u8a00\u3048\u3063\u3053\u306a\u3044\u306e\u3067\u3042\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3044\u308d\u3093\u306a\u30d6\u30ed\u30b0\u3067java\u3092\u4f7f\u3063\u305fHTTPS\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5b9f\u88c5\u306b\u3064\u3044\u3066\u66f8\u304b\u308c\u3066\u3044\u308b\u3002 \u3060\u304c\u9069\u5f53\u306a\u8a18\u4e8b\u304c\u591a\u3059\u304e\u3066\u56f0\u308b\u3002RFC\u3092\u8aad\u3093\u3067\u3044\u308b\u306e\u304b\u7591\u554f\u306b\u601d\u3046\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3060\u3002\u3068\u3044\u3046\u304bRFC\u306e\u5b58\u5728\u3092\u77e5\u3089\u306a\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3002 \u3053\u306e\u30d6\u30ed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4,6],"tags":[],"class_list":["post-316","post","type-post","status-publish","format-standard","hentry","category-5","category-4","category-6"],"_links":{"self":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316"}],"version-history":[{"count":2,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":419,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions\/419"}],"wp:attachment":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}