{"id":10374,"date":"2023-06-23T01:43:43","date_gmt":"2023-06-23T08:43:43","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/nodejs-tls-connection\/"},"modified":"2023-06-23T01:43:43","modified_gmt":"2023-06-23T08:43:43","slug":"nodejs-tls-connection","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/","title":{"rendered":"Connecting with TLS using the Node.js SDK"},"content":{"rendered":"<h3 id=\"h-prerequisites\" class=\"wp-block-heading\">\ud544\uc218 \uc870\uac74<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A Couchbase cluster with TLS enabled. Capella clusters are secured with TLS 1.2 out of the box.<\/li>\n\n\n<li>A Node.js Project using Couchbase (see our other Node.js-based tutorials to get started!)<\/li>\n\n\n<li>Code Editor<\/li>\n\n\n<li>A root certificate for your cluster. For Capella clusters, this can be found at the bottom of the &#8216;Connect&#8217; tab for a given cluster.<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-different-authentication-methods\" class=\"wp-block-heading\">Different Authentication Methods<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We can authenticate a Couchbase connection in a variety of different ways.<\/p>\n\n\n\n<h4 id=\"h-basic-usernamepassword-authentication\" class=\"wp-block-heading\">Basic Username\/Password Authentication<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This authentication method commonly used for locally hosted development clusters. It&#8217;s the easiest method for getting started quickly, but its also not very secure. The benefit of using basic authentication is that there is no additional TLS configuration required when setting up your local Couchbase cluster.<\/p>\n\n\n\n<pre class=\"wp-block-code language-js\"><code>var cluster = await couchbase.connect(&#039;couchbase:\/\/localhost&#039;, {\n  username: &#039;Administrator&#039;,\n  password: &#039;password&#039;,\n})\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that this connection string begins with <code>couchbase:\/\/<\/code>, denoting a non-TLS connection (think <code>http:\/\/<\/code>).<\/p>\n\n\n\n<h4 id=\"h-tls-authentication-without-certificate-checking\" class=\"wp-block-heading\">TLS Authentication without certificate checking<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In certain situations, such as when using Capella, TLS is required. To circumvent the need to download a certificate, the parameter <code>?tls_verify=none<\/code> can be passed with the connection string to ignore mismatched certificates.<\/p>\n\n\n\n<pre class=\"wp-block-code language-js\"><code>const cluster = await couchbase.connect(&#039;couchbases:\/\/&#039;+ endpoint +&#039;?tls_verify=none&#039;, {\n  username: &#039;Administrator&#039;,\n  password: &#039;password&#039;\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that this connection string begins with <code>couchbases:\/\/<\/code>, with the &#8216;s&#8217; denoting a TLS-secured connection (think <code>https:\/\/<\/code>). This is a great way of connecting for development purposes, but it&#8217;s important to understand that this method is <strong>not recommended for use in production<\/strong>.<\/p>\n\n\n\n<h4 id=\"h-tls-authentication-with-proper-certificate-checking\" class=\"wp-block-heading\">TLS Authentication with proper certificate checking<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To properly secure our connection, we&#8217;ll remove the <code>?tls_verify=none<\/code> parameter and instead add a <code>\ubcf4\uc548<\/code> object that contains a <code>trustStorePath<\/code> string that locates the root certificate file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-js\"><code>const cluster = await couchbase.connect(&#039;couchbases:\/\/&#039;+ endpoint, {\n  username: &#039;Administrator&#039;,\n  password: &#039;password&#039;,\n  security: {\n    trustStorePath: &quot;\/path\/to\/root\/certificate.pem&quot;\n  }\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that we&#8217;re still using <code>couchbases:\/\/<\/code> here. You&#8217;ll have to download the root certificate file(s). In Capella, this is located at the bottom of the &#8216;Connect&#8217; tab for a given cluster.<\/p>\n\n\n\n<h3 id=\"h-conclusion\" class=\"wp-block-heading\">\uacb0\ub860<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Hopefully this brief tutorial has shed some light on the various authentication methods you can use with Couchbase. You can always <a href=\"https:\/\/docs.couchbase.com\/nodejs-sdk\/current\/howtos\/sdk-authentication.html#authenticating-a-node-js-client-by-certificate\">read more in the documentation<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The purpose of this tutorial is to help developers switch from basic authentication and\/or ignoring TLS certificates for development to a properly encrypted connection for use in production. This is a really important step to ensuring your application is safe from bad actors!<\/p>","protected":false},"excerpt":{"rendered":"<p>Prerequisites Different Authentication Methods We can authenticate a Couchbase connection in a variety of different ways. Basic Username\/Password Authentication This authentication method commonly used for locally hosted development clusters. It&#8217;s the easiest method for getting started quickly, but its also not very secure. The benefit of using basic authentication is that there is no additional [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[653],"tutorial-tags":[553,667],"tutorial-technologies":[562,554],"tutorial-types":[555],"class_list":["post-10374","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-nodejs","tutorial-tags-configuration","tutorial-tags-tls","tutorial-technologies-capella","tutorial-technologies-server","tutorial-types-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Connecting with TLS using the Node.js SDK - Couchbase<\/title>\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.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Connecting with TLS using the Node.js SDK\" \/>\n<meta property=\"og:description\" content=\"Prerequisites Different Authentication Methods We can authenticate a Couchbase connection in a variety of different ways. Basic Username\/Password Authentication This authentication method commonly used for locally hosted development clusters. It&#8217;s the easiest method for getting started quickly, but its also not very secure. The benefit of using basic authentication is that there is no additional [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/nodejs-tls-connection\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/nodejs-tls-connection\\\/\",\"name\":\"Connecting with TLS using the Node.js SDK - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#website\"},\"datePublished\":\"2023-06-23T08:43:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/nodejs-tls-connection\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/nodejs-tls-connection\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/nodejs-tls-connection\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Connecting with TLS using the Node.js SDK\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Connecting with TLS using the Node.js SDK - Couchbase","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.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/","og_locale":"ko_KR","og_type":"article","og_title":"Connecting with TLS using the Node.js SDK","og_description":"Prerequisites Different Authentication Methods We can authenticate a Couchbase connection in a variety of different ways. Basic Username\/Password Authentication This authentication method commonly used for locally hosted development clusters. It&#8217;s the easiest method for getting started quickly, but its also not very secure. The benefit of using basic authentication is that there is no additional [&hellip;]","og_url":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/","url":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/","name":"Connecting with TLS using the Node.js SDK - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/ko\/#website"},"datePublished":"2023-06-23T08:43:43+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/nodejs-tls-connection\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Connecting with TLS using the Node.js SDK"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/ko\/#website","url":"https:\/\/www.couchbase.com\/ko\/","name":"\ucf54\uc6b0\uce58\ubca0\uc774\uc2a4","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/ko\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/ko\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/ko\/#organization","name":"\ucf54\uc6b0\uce58\ubca0\uc774\uc2a4","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/ko\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/ko\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/ko\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase\ub294 \uce98\ub9ac\ud3ec\ub2c8\uc544\uc8fc \uc0cc\ud638\uc138\uc5d0 \ubcf8\uc0ac\ub97c \ub454 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \ud68c\uc0ac\ub85c, \uc218\ubc31 \uac1c\uc758 \uae00\ub85c\ubc8c \uae30\uc5c5\uc5d0\uc11c \ud65c\uc6a9\ud558\ub294 \uc778\uacf5\uc9c0\ub2a5\uc744 \uc704\ud55c \uc6b4\uc601 \ub370\uc774\ud130 \ud50c\ub7ab\ud3fc\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials\/10374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials\/10374\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/media?parent=10374"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-languages?post=10374"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-tags?post=10374"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-technologies?post=10374"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-types?post=10374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}