{"id":32251,"date":"2014-10-31T07:00:02","date_gmt":"2014-10-31T05:00:02","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=32251"},"modified":"2014-10-30T08:19:18","modified_gmt":"2014-10-30T06:19:18","slug":"securing-websocket-using-wss-and-httpstls","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html","title":{"rendered":"Securing WebSocket using wss and HTTPS\/TLS"},"content":{"rendered":"<p>50th tip on this blog,\u00a0yaay!<\/p>\n<p><a href=\"http:\/\/blog.arungupta.me\/2014\/10\/securing-websockets-username-password-servlet-security-techtip49\/\">Tech Tip #49<\/a>\u00a0explained how to secure WebSockets using username\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip will\u00a0explain how to secure WebSockets using HTTPS\/TLS on WildFly.<\/p>\n<p>Lets get started!<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<ol>\n<li>Create a new keystore:\n<pre class=\" brush:java\">keytool -genkey -alias websocket -keyalg RSA -keystore websocket.keystore -validity 10950\r\nEnter keystore password:\r\nRe-enter new password:\r\nWhat is your first and last name?\r\n  [Unknown]:  Arun Gupta\r\nWhat is the name of your organizational unit?\r\n  [Unknown]:  JBoss Middleware\r\nWhat is the name of your organization?\r\n  [Unknown]:  Red Hat\r\nWhat is the name of your City or Locality?\r\n  [Unknown]:  San Jose\r\nWhat is the name of your State or Province?\r\n  [Unknown]:  CA\r\nWhat is the two-letter country code for this unit?\r\n  [Unknown]:  US\r\nIs CN=Arun Gupta, OU=JBoss Middleware, O=Red Hat, L=San Jose, ST=CA, C=US correct?\r\n  [no]:  yes\r\n\r\nEnter key password for &lt;websocket&gt;\r\n\t(RETURN if same as keystore password):\r\nRe-enter new password:<\/pre>\n<p>Used \u201cwebsocket\u201d as the convenience password.<\/li>\n<li>Download <a href=\"http:\/\/download.jboss.org\/wildfly\/8.1.0.Final\/wildfly-8.1.0.Final.zip\">WildFly 8.1<\/a>, unzip, and copy \u201cwebsocket.keystore\u201d file in <code>standalone\/configuration<\/code> directory.<\/li>\n<li>Start WildFly as:\n<pre class=\" brush:java\">.\/bin\/standalone.sh<\/pre>\n<\/li>\n<li>Connect to it using jboss-cli as:\n<pre class=\" brush:java\">.\/bin\/jboss-cli.sh -c<\/pre>\n<\/li>\n<li>Add a new security realm as:\n<pre class=\" brush:java\">[standalone@localhost:9990 \/] \/core-service=management\/security-realm=WebSocketRealm:add()\r\n{\"outcome\" =&gt; \"success\"}<\/pre>\n<p>And configure it:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java;wrap-lines:false\">[standalone@localhost:9990 \/] \/core-service=management\/security-realm=WebSocketRealm\/server-identity=ssl:add(keystore-path=websocket.keystore, keystore-relative-to=jboss.server.config.dir, keystore-password=websocket)\r\n{\r\n\u00a0 \u00a0\u00a0\"outcome\" =&gt; \"success\",\r\n    \"response-headers\" =&gt; {\r\n        \"operation-requires-reload\" =&gt; true,\r\n        \"process-state\" =&gt; \"reload-required\"\r\n    }\r\n}<\/pre>\n<\/li>\n<li>Add a new HTTPS listener as:\n<pre class=\" brush:java;wrap-lines:false\">[standalone@localhost:9990 \/] \/subsystem=undertow\/server=default-server\/https-listener=https:add(socket-binding=https, security-realm=WebSocketRealm)\r\n{\r\n    \"outcome\" =&gt; \"success\",\r\n  \u00a0 \"response-headers\" =&gt; {\"process-state\" =&gt; \"reload-required\"}\r\n}<\/pre>\n<\/li>\n<li>A simple sample to show TLS-based security for WebSocket is available at\u00a0<a href=\"https:\/\/github.com\/javaee-samples\/javaee7-samples\/tree\/master\/websocket\/endpoint-wss\">github.com\/javaee-samples\/javaee7-samples\/tree\/master\/websocket\/endpoint-wss<\/a>. Clone the workspace and change directory to \u201cwebsocket\/endpoint-wss\u201d. The sample\u2019s deployment descriptor has:\n<pre class=\" brush:xml\">&lt;security-constraint&gt;\r\n  &lt;web-resource-collection&gt;\r\n    &lt;web-resource-name&gt;Secure WebSocket&lt;\/web-resource-name&gt;\r\n    &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;\r\n  &lt;\/web-resource-collection&gt;\r\n  &lt;user-data-constraint&gt;\r\n    &lt;transport-guarantee&gt;CONFIDENTIAL&lt;\/transport-guarantee&gt;\r\n  &lt;\/user-data-constraint&gt;\r\n&lt;\/security-constraint&gt;<\/pre>\n<p>This ensures that any request coming to this application\u00a0will be auto-directed to an HTTPS URL.<\/li>\n<li>Deploy the sample by giving the command:\n<pre class=\" brush:java\">mvn wildfly:deploy<\/pre>\n<\/li>\n<\/ol>\n<p>Now accessing <a href=\"http:\/\/localhost:8080\/endpoint-wss\">http:\/\/localhost:8080\/endpoint-wss<\/a>\u00a0redirects to\u00a0<a href=\"http:\/\/localhost:8080\/endpoint-wss\">https:\/\/localhost:8080\/endpoint-wss<\/a>. The browsers may complain about self-signed certificate. For example, Chrome shows the following warning:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate-chrome.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-32297\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate-chrome.png\" alt=\"techtip50-certificate-chrome\" width=\"686\" height=\"570\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate-chrome.png 1276w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate-chrome-300x249.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate-chrome-1024x850.png 1024w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><\/a><\/p>\n<p>And Safari shows the following warning:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-32298\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate.png\" alt=\"techtip50-certificate\" width=\"686\" height=\"851\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate.png 1076w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/techtip50-certificate-241x300.png 241w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><\/a><\/p>\n<p>In either case, click on \u201cProceed to localhost\u201d or \u201cContinue\u201d to proceed further. And then a\u00a0secure WebSocket connection is established.<\/p>\n<p>Another relevant\u00a0point to understand is that a non-secure WebSocket connection cannot be made from an https-protected page. For example the following code in our sample:<\/p>\n<pre class=\" brush:java\">new WebSocket(\"ws:\/\/localhost:8080\/endpoint-wss\/websocket\");<\/pre>\n<p>will throw the following exception in Chrome Developer Tools:<\/p>\n<pre class=\" brush:java;wrap-lines:false\">[blocked] The page at 'https:\/\/localhost:8443\/endpoint-wss\/index.jsp' was loaded over HTTPS, but ran insecure content from 'ws:\/\/localhost:8080\/endpoint-wss\/websocket': this content should also be loaded over HTTPS.\r\nUncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.<\/pre>\n<p>Enjoy!<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.arungupta.me\/2014\/10\/securing-websocket-wss-https-tls-techtip50\/\">Securing WebSocket using wss and HTTPS\/TLS<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\/\">JCG partner<\/a> Arun Gupta at the <a href=\"http:\/\/blog.arungupta.me\/\">Miles to go 2.0 \u2026<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>50th tip on this blog,\u00a0yaay! Tech Tip #49\u00a0explained how to secure WebSockets using username\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip will\u00a0explain how to secure WebSockets using HTTPS\/TLS on WildFly. Lets get started! &nbsp; &nbsp; &nbsp; &nbsp; Create a new keystore: keytool -genkey -alias websocket -keyalg RSA -keystore websocket.keystore -validity 10950 Enter keystore password: Re-enter new password: &hellip;<\/p>\n","protected":false},"author":598,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[399],"class_list":["post-32251","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-websockets"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Securing WebSocket using wss and HTTPS\/TLS<\/title>\n<meta name=\"description\" content=\"50th tip on this blog,\u00a0yaay! Tech Tip #49\u00a0explained how to secure WebSockets using username\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Securing WebSocket using wss and HTTPS\/TLS\" \/>\n<meta property=\"og:description\" content=\"50th tip on this blog,\u00a0yaay! Tech Tip #49\u00a0explained how to secure WebSockets using username\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-31T05:00:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Arun Gupta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/arungupta\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Gupta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html\"},\"author\":{\"name\":\"Arun Gupta\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/82c06e0d9eea6c8a425a0675ed3d932f\"},\"headline\":\"Securing WebSocket using wss and HTTPS\\\/TLS\",\"datePublished\":\"2014-10-31T05:00:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html\"},\"wordCount\":258,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"WebSockets\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html\",\"name\":\"Securing WebSocket using wss and HTTPS\\\/TLS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2014-10-31T05:00:02+00:00\",\"description\":\"50th tip on this blog,\u00a0yaay! Tech Tip #49\u00a0explained how to secure WebSockets using username\\\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/10\\\/securing-websocket-using-wss-and-httpstls.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Securing WebSocket using wss and HTTPS\\\/TLS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/82c06e0d9eea6c8a425a0675ed3d932f\",\"name\":\"Arun Gupta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f9ef0a5821c07ed6acc75261b8935b85c5a19e42e60e5eaa01b1c065c76e0fd3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f9ef0a5821c07ed6acc75261b8935b85c5a19e42e60e5eaa01b1c065c76e0fd3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f9ef0a5821c07ed6acc75261b8935b85c5a19e42e60e5eaa01b1c065c76e0fd3?s=96&d=mm&r=g\",\"caption\":\"Arun Gupta\"},\"description\":\"Arun is a technology enthusiast, avid runner, author of a best-selling book, globe trotter, a community guy, Java Champion, JavaOne Rockstar, JUG Leader, Minecraft Modder, Devoxx4Kids-er, and a Red Hatter.\",\"sameAs\":[\"http:\\\/\\\/blog.arungupta.me\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/arungupta\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/arun-gupta\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Securing WebSocket using wss and HTTPS\/TLS","description":"50th tip on this blog,\u00a0yaay! Tech Tip #49\u00a0explained how to secure WebSockets using username\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html","og_locale":"en_US","og_type":"article","og_title":"Securing WebSocket using wss and HTTPS\/TLS","og_description":"50th tip on this blog,\u00a0yaay! Tech Tip #49\u00a0explained how to secure WebSockets using username\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip","og_url":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-10-31T05:00:02+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Arun Gupta","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/arungupta","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Arun Gupta","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html"},"author":{"name":"Arun Gupta","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/82c06e0d9eea6c8a425a0675ed3d932f"},"headline":"Securing WebSocket using wss and HTTPS\/TLS","datePublished":"2014-10-31T05:00:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html"},"wordCount":258,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["WebSockets"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html","url":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html","name":"Securing WebSocket using wss and HTTPS\/TLS","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2014-10-31T05:00:02+00:00","description":"50th tip on this blog,\u00a0yaay! Tech Tip #49\u00a0explained how to secure WebSockets using username\/password\u00a0and Servlet Security mechanisms.\u00a0This Tech Tip","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/10\/securing-websocket-using-wss-and-httpstls.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Securing WebSocket using wss and HTTPS\/TLS"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/82c06e0d9eea6c8a425a0675ed3d932f","name":"Arun Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f9ef0a5821c07ed6acc75261b8935b85c5a19e42e60e5eaa01b1c065c76e0fd3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f9ef0a5821c07ed6acc75261b8935b85c5a19e42e60e5eaa01b1c065c76e0fd3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f9ef0a5821c07ed6acc75261b8935b85c5a19e42e60e5eaa01b1c065c76e0fd3?s=96&d=mm&r=g","caption":"Arun Gupta"},"description":"Arun is a technology enthusiast, avid runner, author of a best-selling book, globe trotter, a community guy, Java Champion, JavaOne Rockstar, JUG Leader, Minecraft Modder, Devoxx4Kids-er, and a Red Hatter.","sameAs":["http:\/\/blog.arungupta.me\/","https:\/\/x.com\/https:\/\/twitter.com\/arungupta"],"url":"https:\/\/www.javacodegeeks.com\/author\/arun-gupta"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/598"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=32251"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32251\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=32251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=32251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=32251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}