{"id":4205,"date":"2021-04-05T17:08:01","date_gmt":"2021-04-05T17:08:01","guid":{"rendered":"https:\/\/codethataint.com\/blog\/?p=4205"},"modified":"2021-04-05T17:31:24","modified_gmt":"2021-04-05T17:31:24","slug":"spring-security-using-https-for-crud-by-installing-ssl","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/spring-security-using-https-for-crud-by-installing-ssl\/","title":{"rendered":"Spring Security &#8211; Using https for CRUD by installing SSL"},"content":{"rendered":"<ol>\n<li>Till now we were sending requests over HTTP. Now lets make HTTP secured using https by installing certificate in our project<\/li>\n<li>To generate certificate we use Key Store Explorer and will generate PKCS#12 Certificate<br \/>\n<img decoding=\"async\" src=\"https:\/\/codethataint.com\/blog\/wp-content\/uploads\/2021\/04\/PKCS2.jpg\" alt=\"\" \/><\/p>\n<\/li>\n<li>Generate a public and private key and save the keystore<\/li>\n<li>The Keystore should be copied to the resources folder and the credentials of the keystore should be added to application.properties as below.\n<p><strong>application.properties<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n# The format used for the keystore. It could be set to JKS in case it is a JKS file\r\nserver.ssl.key-store-type=PKCS12\r\n# The path to the keystore containing the certificate\r\nserver.ssl.key-store=classpath:TestCert\r\n# The password used to generate the certificate\r\nserver.ssl.key-store-password=password\r\n<\/pre>\n<\/li>\n<li>Since the certificare generated(keystore file) cannot be cross checked with CA(Certificate Authority) it would display message like one below for the authenticy of certificate, whether it should be accpeted or not. How ever you can continue further by clicking on advanced<br \/>\n<img decoding=\"async\" src=\"https:\/\/codethataint.com\/blog\/wp-content\/uploads\/2021\/04\/PrivacyError.jpg\" alt=\"\" \/>\n<\/li>\n<\/ol>\n<p><strong>Note:<\/strong> While performing CRUD the addition of user is a JSON request which should be carried out only from postman. For this enable interceptor plugin in Chrome so that cookies set in chrome would be available in Postman.<\/p>\n<p>Further Reads:<br \/>\n<a href=\"https:\/\/codethataint.com\/blog\/wp-content\/uploads\/2021\/04\/How-SSL-works.zip\">How SSL Works<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Till now we were sending requests over HTTP. Now lets make HTTP secured using https by installing certificate in our project To generate certificate we use Key Store Explorer and will generate PKCS#12 Certificate Generate a public and private key and save the keystore The Keystore should be copied to the resources folder and the&hellip; <a href=\"https:\/\/codethataint.com\/blog\/spring-security-using-https-for-crud-by-installing-ssl\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[325],"tags":[],"class_list":["post-4205","post","type-post","status-publish","format-standard","hentry","category-spring-security"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/4205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=4205"}],"version-history":[{"count":5,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/4205\/revisions"}],"predecessor-version":[{"id":4215,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/4205\/revisions\/4215"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=4205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=4205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=4205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}