From 97d4ce232a95df2029cdfae0c239ffd3b6bf2ca0 Mon Sep 17 00:00:00 2001
From: isaacs
Date: Sun, 4 Sep 2011 20:30:03 -0700
Subject: [PATCH] Add 'ca' config
---
doc/config.md | 11 +++++++++++
html/doc/config.html | 10 ++++++++++
html/doc/get.html | 10 ++++++++++
html/doc/set.html | 10 ++++++++++
lib/utils/config-defs.js | 20 ++++++++++++++++++++
man1/config.1 | 18 ++++++++++++++++++
man1/get.1 | 18 ++++++++++++++++++
man1/set.1 | 18 ++++++++++++++++++
8 files changed, 115 insertions(+)
diff --git a/doc/config.md b/doc/config.md
index 71ea750ef04c8..66a4f917b4769 100644
--- a/doc/config.md
+++ b/doc/config.md
@@ -174,6 +174,17 @@ It's yet to be seen if this is a good idea.
The browser that is called by the `npm docs` command to open websites.
+### ca
+
+* Default: The npm CA certificate
+* Type: String or null
+
+The Certificate Authority signing certificate that is trusted for SSL
+connections to the registry.
+
+Set to `null` to only allow "known" registrars, or to a specific CA cert
+to trust only that specific signing authority.
+
### cache
* Default: Windows: `~/npm-cache`, Posix: `~/.npm`
diff --git a/html/doc/config.html b/html/doc/config.html
index f9bae7bf989c0..3dbebf99f6944 100644
--- a/html/doc/config.html
+++ b/html/doc/config.html
@@ -156,6 +156,16 @@ browser
The browser that is called by the npm docs
command to open websites.
+ca
+
+- Default: The npm CA certificate
- Type: String or null
+
+The Certificate Authority signing certificate that is trusted for SSL
+connections to the registry.
+
+Set to null
to only allow "known" registrars, or to a specific CA cert
+to trust only that specific signing authority.
+
cache
- Default: Windows:
~/npm-cache
, Posix: ~/.npm
- Type: path
diff --git a/html/doc/get.html b/html/doc/get.html
index 99484b473e4a7..604bf92a59a0c 100644
--- a/html/doc/get.html
+++ b/html/doc/get.html
@@ -156,6 +156,16 @@ browser
The browser that is called by the npm docs
command to open websites.
+ca
+
+- Default: The npm CA certificate
- Type: String or null
+
+The Certificate Authority signing certificate that is trusted for SSL
+connections to the registry.
+
+Set to null
to only allow "known" registrars, or to a specific CA cert
+to trust only that specific signing authority.
+
cache
- Default: Windows:
~/npm-cache
, Posix: ~/.npm
- Type: path
diff --git a/html/doc/set.html b/html/doc/set.html
index c602d4cbb5a0b..de962541a8dd3 100644
--- a/html/doc/set.html
+++ b/html/doc/set.html
@@ -156,6 +156,16 @@ browser
The browser that is called by the npm docs
command to open websites.
+ca
+
+- Default: The npm CA certificate
- Type: String or null
+
+The Certificate Authority signing certificate that is trusted for SSL
+connections to the registry.
+
+Set to null
to only allow "known" registrars, or to a specific CA cert
+to trust only that specific signing authority.
+
cache
- Default: Windows:
~/npm-cache
, Posix: ~/.npm
- Type: path
diff --git a/lib/utils/config-defs.js b/lib/utils/config-defs.js
index a95d7895bbdcd..78c04b6383e7b 100644
--- a/lib/utils/config-defs.js
+++ b/lib/utils/config-defs.js
@@ -74,6 +74,25 @@ Object.defineProperty(exports, "defaults", {get: function () {
, browser : process.platform === "darwin" ? "open"
: process.platform === "win32" ? "start"
: "google-chrome"
+
+ , ca : // the npm CA certificate.
+ "-----BEGIN CERTIFICATE-----\n"+
+ "MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC\n"+
+ "VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x\n"+
+ "IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w\n"+
+ "bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y\n"+
+ "MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV\n"+
+ "BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj\n"+
+ "YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA\n"+
+ "aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE\n"+
+ "OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz\n"+
+ "Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl\n"+
+ "y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC\n"+
+ "l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv\n"+
+ "yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl\n"+
+ "ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op\n"+
+ "-----END CERTIFICATE-----\n"
+
, cache : path.resolve( home || temp
, process.platform === "win32"
? "npm-cache" : ".npm")
@@ -148,6 +167,7 @@ exports.types =
, "bin-publish" : Boolean
, bindist : [String, null]
, browser : String
+ , ca: [null, String]
, cache : path
, color : ["always", Boolean]
, depth : Number
diff --git a/man1/config.1 b/man1/config.1
index 6f30218f18384..f6cc903e430f3 100644
--- a/man1/config.1
+++ b/man1/config.1
@@ -310,6 +310,24 @@ Type: String
.P
The browser that is called by the \fBnpm docs\fR command to open websites\.
.
+.SS "ca"
+.
+.IP "\(bu" 4
+Default: The npm CA certificate
+.
+.IP "\(bu" 4
+Type: String or null
+.
+.IP "" 0
+.
+.P
+The Certificate Authority signing certificate that is trusted for SSL
+connections to the registry\.
+.
+.P
+Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert
+to trust only that specific signing authority\.
+.
.SS "cache"
.
.IP "\(bu" 4
diff --git a/man1/get.1 b/man1/get.1
index 6f30218f18384..f6cc903e430f3 100644
--- a/man1/get.1
+++ b/man1/get.1
@@ -310,6 +310,24 @@ Type: String
.P
The browser that is called by the \fBnpm docs\fR command to open websites\.
.
+.SS "ca"
+.
+.IP "\(bu" 4
+Default: The npm CA certificate
+.
+.IP "\(bu" 4
+Type: String or null
+.
+.IP "" 0
+.
+.P
+The Certificate Authority signing certificate that is trusted for SSL
+connections to the registry\.
+.
+.P
+Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert
+to trust only that specific signing authority\.
+.
.SS "cache"
.
.IP "\(bu" 4
diff --git a/man1/set.1 b/man1/set.1
index 6f30218f18384..f6cc903e430f3 100644
--- a/man1/set.1
+++ b/man1/set.1
@@ -310,6 +310,24 @@ Type: String
.P
The browser that is called by the \fBnpm docs\fR command to open websites\.
.
+.SS "ca"
+.
+.IP "\(bu" 4
+Default: The npm CA certificate
+.
+.IP "\(bu" 4
+Type: String or null
+.
+.IP "" 0
+.
+.P
+The Certificate Authority signing certificate that is trusted for SSL
+connections to the registry\.
+.
+.P
+Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert
+to trust only that specific signing authority\.
+.
.SS "cache"
.
.IP "\(bu" 4