{"id":8537,"date":"2020-10-29T05:09:00","date_gmt":"2020-10-29T05:09:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8537"},"modified":"2025-08-25T04:39:40","modified_gmt":"2025-08-25T04:39:40","slug":"how-to-enable-ssl-in-postgresql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/","title":{"rendered":"How to Enable SSL in PostgreSQL"},"content":{"rendered":"\n<p>Database Security is a top concern for every database administrator. One of the simplest ways to secure your data in transit is to send &amp; receive it over SSL connection. PostgreSQL supports SSL connection that allow users to securely connect to their databases. Once the connection is made, all subsequent data exchanges happen over SSL\/TLS connection. In this article we will look at how to enable SSL in PostgreSQL database.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#How_to_Enable_SSL_in_PostgreSQL\" >How to Enable SSL in PostgreSQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#1_Generate_SSL_Certificates\" >1. Generate SSL Certificates<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#2_Modify_File_Permissions\" >2. Modify File Permissions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#3_Generate_Self-Signed_Certificate\" >3. Generate Self-Signed Certificate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#4_Configure_PostgreSQL_to_use_SSL_Certificates\" >4. Configure PostgreSQL to use SSL Certificates<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#5_Test_SSL_Connection\" >5. Test SSL Connection<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#6_Enable_SSL_in_PostgreSQL_client_Optional\" >6. Enable SSL in PostgreSQL client (Optional)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Enable_SSL_in_PostgreSQL\"><\/span>How to Enable SSL in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We have assumed that you already have a PostgreSQL database up and running, and you also have a PostgreSQL database user. Here are the steps to enable SSL connection in PostgreSQL. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Generate_SSL_Certificates\"><\/span>1. Generate SSL Certificates<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>On PostgreSQL server, we need 3 certificates in data directory for SSL configuration. They are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>root.crt<\/em>&nbsp;(trusted root certificate)<\/li>\n\n\n\n<li><em>server.crt<\/em>&nbsp;(server certificate)<\/li>\n\n\n\n<li><em>server.key<\/em>&nbsp;(private key)<\/li>\n<\/ul>\n\n\n\n<p>Open terminal and run the following command to run as root<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo -\n$ <code>cd \/var\/lib\/pgsql\/data<\/code><\/pre>\n\n\n\n<p>Generate private key using <a href=\"https:\/\/www.openssl.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">openssl<\/a>. You will be prompted for passphrase.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>openssl genrsa -des3 -out server.key 1024<\/code><\/pre>\n\n\n\n<p>Remove passphrase<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>openssl rsa -in server.key -out server.key<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Modify_File_Permissions\"><\/span>2. Modify File Permissions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It is important to assign read-only permissions to your files. Update the file permission and ownership of private key file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>chmod 400 server.key\n$ chown postgres.postgres server.key<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Generate_Self-Signed_Certificate\"><\/span>3. Generate Self-Signed Certificate<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Next, we create a self-signed certificate valid for 365 days. Run the following command for this purpose.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>openssl req -new -key server.key -days 365 -out server.crt -x509<\/code><\/pre>\n\n\n\n<p>In the above statement, -x509 indicates a self-signed certificate and 365 indicates validity of 365 days. You will be prompted for details such as email, country, etc. Enter it and complete the certificate generation.<\/p>\n\n\n\n<p>Since we are using self-signed certificate we will use our server key as root certificate.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>cp server.crt root.crt<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Configure_PostgreSQL_to_use_SSL_Certificates\"><\/span>4. Configure PostgreSQL to use SSL Certificates<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open postgresql.conf configuration file located in data directory. Replace &lt;version&gt; with the version of PostgreSQL database.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/var\/lib\/pgsql\/<strong>&lt;version&gt;<\/strong>\/data\/postgresql.conf<\/pre>\n\n\n\n<p>Look for listen_addresses and set it to the following.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">listen_addresses = '*'<\/pre>\n\n\n\n<p>Update the following parameters to values shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssl = on<br>ssl_ca_file = 'root.crt'<br>ssl_cert_file = 'server.crt'<br>ssl_crl_file = ''<br>ssl_key_file = 'server.key'<br>ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers<br>ssl_prefer_server_ciphers = on<\/pre>\n\n\n\n<p>Save and close the file. This will allow PostgreSQL to accept SSL connections.<\/p>\n\n\n\n<p>Open pg_hba.conf file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/var\/lib\/pgsql\/<strong>&lt;version&gt;<\/strong>\/data\/pg_hba.conf<\/pre>\n\n\n\n<p>Update pg_hba.conf to add the following lines to accept SSL connections from all hosts.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># IPv4 remote connections for authenticated users \nhostssl all www-data 0.0.0.0\/0 md5 clientcert=1\nhostssl all postgres 0.0.0.0\/0 md5 clientcert=1<\/pre>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<p>Restart PostgreSQL Server<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>\/etc\/init.d\/postgresql restart<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Test_SSL_Connection\"><\/span>5. Test SSL Connection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Log into PostgreSQL database with the following command. You will be prompted for password. Enter it to make connection.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ psql -U &lt;username&gt; -p 5432 -h &lt;hostname or ip&gt;<\/pre>\n\n\n\n<p>On successful connection, you will see the message <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SSL Connection (protocol: TLS v1.3 ...<\/pre>\n\n\n\n<p>The above steps enable SSL connections only in PostgreSQL server. If you also want to enable SSL connection in PostgreSQL client, follow the next step.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Enable_SSL_in_PostgreSQL_client_Optional\"><\/span>6. Enable SSL in PostgreSQL client (Optional)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We also need 3 files to enable SSL in PostgreSQL client. We will store them at <em>~\/.postgresql\/<\/em>&nbsp;directory<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>root.crt<\/em>&nbsp;(trusted root certificate)<\/li>\n\n\n\n<li><em>postgresql.crt<\/em>&nbsp;(client certificate)<\/li>\n\n\n\n<li><em>postgresql.key<\/em>&nbsp;(private key)<\/li>\n<\/ul>\n\n\n\n<p>Create <em>postgresql.key<\/em> on client machine and remove passphrase.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>openssl genrsa -des3 -out \/tmp\/postgresql.key 1024<\/code>\n$ <code>openssl rsa -in \/tmp\/postgresql.key -out \/tmp\/postgresql.key<\/code><\/pre>\n\n\n\n<p>Next, we create postgresql.crt, and sign it with using the trusted root (private key file from server). <strong>Please note<\/strong>, when you are prompted for certificate common name (CN), set it to database name.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ <code>openssl req -new -key \/tmp\/postgresql.key -out \/tmp\/postgresql.csr<\/code>\n$ <code>openssl x509 -req -in server.req -out \/tmp\/postgresql.csr -CA root.crt -CAkey server.key -out \/tmp\/postgresql.crt -CAcreateserial<\/code><\/pre>\n\n\n\n<p>Copy the three files created in server&#8217;s \/tmp directory to client machine. Copy root.crt from server \/tmp directory to client&#8217;s <em>~\/.postgresql\/<\/em> directory.<\/p>\n\n\n\n<p>This will enable SSL in PostgreSQL client as well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to enable SSL in PostgreSQL Server as well as client. You can use these steps to establish secure SSL connection to your database and exchange data over SSL\/TLS. SSL database connections allow you to protect your data from snooping and other attacks. You can use these steps on almost all PostgreSQL versions, just by changing the version number in step #4.<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data, and monitor them in real-time dashboards.&nbsp;<a href=\"https:\/\/ubiq.co\/accounts\/register\">Try Ubiq<\/a>&nbsp;for free.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-pivot-table-in-postgresql\/\">How to Create Pivot Table in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/top-5-free-database-design-tools\/\">Top Free Database Design Tools<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/\">How to Compare Schemas in PostgreSQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL supports secure SSL\/TLS database connections. Here is how to enable SSL in PostgreSQL.<\/p>\n","protected":false},"author":1,"featured_media":8540,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[348],"tags":[81,80,485],"class_list":["post-8537","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-https","tag-ssl","tag-tls"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Enable SSL in PostgreSQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"PostgreSQL supports secure SSL\/TLS database connections. Here is how to enable SSL in PostgreSQL. Secure PostgreSQL connection with SSL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable SSL in PostgreSQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"PostgreSQL supports secure SSL\/TLS database connections. Here is how to enable SSL in PostgreSQL. Secure PostgreSQL connection with SSL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-29T05:09:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-25T04:39:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"730\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\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:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Enable SSL in PostgreSQL\",\"datePublished\":\"2020-10-29T05:09:00+00:00\",\"dateModified\":\"2025-08-25T04:39:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\"},\"wordCount\":624,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1\",\"keywords\":[\"https\",\"ssl\",\"tls\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\",\"name\":\"How to Enable SSL in PostgreSQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1\",\"datePublished\":\"2020-10-29T05:09:00+00:00\",\"dateModified\":\"2025-08-25T04:39:40+00:00\",\"author\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"PostgreSQL supports secure SSL\/TLS database connections. Here is how to enable SSL in PostgreSQL. Secure PostgreSQL connection with SSL.\",\"breadcrumb\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1\",\"width\":730,\"height\":410,\"caption\":\"enable ssl postgresql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ubiq.co\/tech-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Enable SSL in PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/\"],\"url\":\"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable SSL in PostgreSQL - Ubiq BI","description":"PostgreSQL supports secure SSL\/TLS database connections. Here is how to enable SSL in PostgreSQL. Secure PostgreSQL connection with SSL.","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:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable SSL in PostgreSQL - Ubiq BI","og_description":"PostgreSQL supports secure SSL\/TLS database connections. Here is how to enable SSL in PostgreSQL. Secure PostgreSQL connection with SSL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-10-29T05:09:00+00:00","article_modified_time":"2025-08-25T04:39:40+00:00","og_image":[{"width":730,"height":410,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp","type":"image\/webp"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Enable SSL in PostgreSQL","datePublished":"2020-10-29T05:09:00+00:00","dateModified":"2025-08-25T04:39:40+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/"},"wordCount":624,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1","keywords":["https","ssl","tls"],"articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/","name":"How to Enable SSL in PostgreSQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1","datePublished":"2020-10-29T05:09:00+00:00","dateModified":"2025-08-25T04:39:40+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"PostgreSQL supports secure SSL\/TLS database connections. Here is how to enable SSL in PostgreSQL. Secure PostgreSQL connection with SSL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1","width":730,"height":410,"caption":"enable ssl postgresql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-ssl-in-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Enable SSL in PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/enable-SSL-postgresql.webp?fit=730%2C410&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2dH","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=8537"}],"version-history":[{"count":3,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8537\/revisions"}],"predecessor-version":[{"id":9277,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8537\/revisions\/9277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8540"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}