defensive-coding-guide/pot/Features/snippets/TLS-Client-OpenJDK-Connect.pot

41 lines
1.1 KiB
Text
Raw Normal View History

2013-03-11 23:20:11 -04:00
#
# AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
2013-08-12 23:12:14 -04:00
"POT-Creation-Date: 2013-08-13T01:54:52\n"
"PO-Revision-Date: 2013-08-13T01:54:52\n"
2013-03-11 23:20:11 -04:00
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: programlisting
#, no-c-format
msgid "\n"
"// Create the socket and connect it at the TCP layer.\n"
"SSLSocket socket = (SSLSocket) ctx.getSocketFactory()\n"
" .createSocket(host, port);\n"
"\n"
"// Disable the Nagle algorithm.\n"
"socket.setTcpNoDelay(true);\n"
"\n"
"// Adjust ciphers and protocols.\n"
"socket.setSSLParameters(params);\n"
"\n"
"// Perform the handshake.\n"
"socket.startHandshake();\n"
"\n"
"// Validate the host name. The match() method throws\n"
"// CertificateException on failure.\n"
"X509Certificate peer = (X509Certificate)\n"
" socket.getSession().getPeerCertificates()[0];\n"
"// This is the only way to perform host name checking on OpenJDK 6.\n"
"HostnameChecker.getInstance(HostnameChecker.TYPE_TLS).match(\n"
" host, peer);\n"
""
msgstr ""