{"id":376,"date":"2018-05-25T21:14:50","date_gmt":"2018-05-25T21:14:50","guid":{"rendered":"https:\/\/www.spotonoracle.com\/?p=376"},"modified":"2018-05-25T21:46:51","modified_gmt":"2018-05-25T21:46:51","slug":"sql-developer-enabling-tls-for-jdbc-thin-driver","status":"publish","type":"post","link":"https:\/\/www.spotonoracle.com\/?p=376","title":{"rendered":"SQL Developer &#8211; enabling TLS for JDBC thin driver"},"content":{"rendered":"<p>I don&#8217;t think this is documented anywhere (and no hits on google) but it shows once again how awsome SQL Developer is. \ud83d\ude42<br \/>\nInstead of using &#8220;jdbc:oracle:oci&#8221; for TLS enabled connections we&#8217;re going to set SQL Developer up to do just that with &#8220;jdbc:oracle:thin&#8221;. In that regard, SQL Developer is no more special than any Java application.<br \/>\nTo keep it short I&#8217;m sticking to the basics, maybe I&#8217;ll add some variations into the comments later.<br \/>\nFirst, we need to add &#8220;OraclePKIProvider&#8221; to the JRE security provider&#8217;s list. The provider&#8217;s list is defined in &#8220;$JAVA_HOME\/jre\/lib\/security\/java.security&#8221;.<br \/>\nI&#8217;m going to append to it by creating a new file that I only source from SQL Developer. In my case, the next free slot is 10. Depending on your OS and JRE version the list may slightly vary.<br \/>\n(also make sure that the java.security file is appendable: &#8220;security.overridePropertiesFile=true&#8221;)<\/p>\n<pre class=\"brush: bash; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\n$ vi \/opt\/sqldeveloper\/sqldeveloper\/bin\/sqldev.java.security\r\nsecurity.provider.10=oracle.security.pki.OraclePKIProvider\r\n<\/pre>\n<p>Next, we add a few options to the sqldeveloper.conf file:<\/p>\n<pre class=\"brush: bash; collapse: false; title: ; wrap-lines: false; notranslate\" title=\"\">\r\n$ vi \/opt\/sqldeveloper\/sqldeveloper\/bin\/sqldeveloper.conf\r\n# add this to end of the config file\r\n\r\n# specify the path to your SSO wallet file\r\nAddVMOption -Doracle.net.wallet_location=&quot;(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=\/home\/btr\/tns\/wallet)))&quot;\r\n# this is required if you want to use TLS authentication next to in-flight traffic encryption\r\nAddVMOption -Doracle.net.authentication_services=&quot;(TCPS)&quot;\r\n# optionally, if you want the client to verify the server certificate\r\nAddVMOption -Doracle.net.ssl_server_dn_match=true\r\n# append\/override JRE security config to add Oracle provider\r\nAddVMOption -Djava.security.properties=\/opt\/sqldeveloper\/sqldeveloper\/bin\/sqldev.java.security\r\n# even SQLDev 18.1 ships with a very old version that is not compatible - just download the latest one from OTN\r\nAddJavaLibFile \/home\/btr\/orasec\/jlib\/oraclepki.jar\r\n<\/pre>\n<p>That&#8217;s it, we&#8217;re done.<\/p>\n<p>Now you can create connections using TNS, LDAP, or Advanced. Basic\/EZCONNECT does not support to specify the protocol, so it can&#8217;t be used for TLS.<\/p>\n<p>Here we only use TLS for in-flight traffic encryption:<br \/>\n<a href=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-300x104.png\" alt=\"\" width=\"300\" height=\"104\" class=\"alignnone size-medium wp-image-377\" srcset=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-300x104.png 300w, https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-768x266.png 768w, https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-624x216.png 624w, https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls.png 937w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>And here, we make use of TLS user authentication:<br \/>\n<a href=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-auth.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-auth-300x106.png\" alt=\"\" width=\"300\" height=\"106\" class=\"alignnone size-medium wp-image-378\" srcset=\"https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-auth-300x106.png 300w, https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-auth-768x272.png 768w, https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-auth-624x221.png 624w, https:\/\/www.spotonoracle.com\/wp-content\/uploads\/2018\/05\/sqldev-tls-auth.png 933w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t think this is documented anywhere (and no hits on google) but it shows once again how awsome SQL Developer is. \ud83d\ude42 Instead of using &#8220;jdbc:oracle:oci&#8221; for TLS enabled connections we&#8217;re going to set SQL Developer up to do just that with &#8220;jdbc:oracle:thin&#8221;. In that regard, SQL Developer is no more special than any [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,12,6],"tags":[],"class_list":["post-376","post","type-post","status-publish","format-standard","hentry","category-general","category-security","category-sqldev"],"_links":{"self":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=376"}],"version-history":[{"count":8,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/376\/revisions"}],"predecessor-version":[{"id":380,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=\/wp\/v2\/posts\/376\/revisions\/380"}],"wp:attachment":[{"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spotonoracle.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}