Skip to content

Commit

Permalink
feat: ability to specify CA file
Browse files Browse the repository at this point in the history
  • Loading branch information
JackuB authored and gjvis committed Oct 11, 2016
1 parent bc58555 commit 97469ee
Show file tree
Hide file tree
Showing 17 changed files with 463 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.env
.nyc_output
coverage
/test/fixtures/certs/tmp
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Public filters are for requests that a recieved on your broker client and are in

- The broker requires at least [email protected]
- Broker clients are *uniquely* identified (i.e. the same ID can't be used twice)
- If your private service is using a self signed https certificate, you will need to add the following environment value when runnning the client: `NODE_TLS_REJECT_UNAUTHORIZED=0`
- If your private service is using an unrecognized certificate, you will need to supply a Certificate Authority file and add the following environment value when runnning the client: `CA_CERT=ca.cert.pem` - Client will load your CA certificate and use it for requests to your internal service

## License

Expand Down
5 changes: 5 additions & 0 deletions lib/relay.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const fs = require('fs');
const path = require('path');
const request = require('request');
const undefsafe = require('undefsafe');
const parse = require('url').parse;
Expand Down Expand Up @@ -112,6 +114,9 @@ function responseHandler(filterRules, config) {
headers: headers,
method,
body,
agentOptions: {
ca: (() => {return config.caCert ? fs.readFileSync(path.resolve(process.cwd(), config.caCert)) : undefined;})(),
},
}, (error, response, body) => {
debug('%s %s (%s)', method, result, (response || { statusCode: 500 }).statusCode);

Expand Down
9 changes: 9 additions & 0 deletions test/fixtures/certs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Generated using [coolaj86/nodejs-self-signed-certificate-example](https://github.com/coolaj86/nodejs-self-signed-certificate-example)

Just run in this directory:

```bash
bash ./generate-certs.sh
```

I'm adding these into the repository and not regenerating with say `postinstall` hook, so we don't rely on openssl being installed.
24 changes: 24 additions & 0 deletions test/fixtures/certs/ca/my-root-ca.crt.pem
Original file line number Diff line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Eg5o5MAwGA1Ud
EwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBACzI+LS7z3DJDbwczhT4lW+qsexv
avXT7x/Zt2Wv+szjNYRA4LYFGTQ/JYCx9J2zg9Cc6uPxjWlJNjwTVT4WLKJPnuQf
PEEcYp5gJqpHBULdWIEcH9IROpnVQeZETTzLuFLGY6Ya8pA2j6E44pxE8c8wVYuP
RLL8ihFKlEi7iQFjPX8Y0Jq2Xfjo9puldN6Jes3SMQfMuP1MIwiDaTNXeyD4ZBBO
3wDVN4dQHV2Fcq8ES9c5jBKpTkg8a8tFp60WKz+eEAg3mGYkFQNBLyG+S8ZhZef1
VAg3jV1MPjlSw7aGrCkadVwXXOJZmOAlQM5D4NvxnuRwLGCzrBv13q+bDqA=
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions test/fixtures/certs/ca/my-root-ca.key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA0jd7aOHIChA616eYOCoxq6UNt3ovEHnj7YcQFn3jzryznrcd
l9bWL1rfbY2OXxnxmzsenpfw0A20l46Ns52hwpXtRnuaGIKKuUTVN66V/CA9tsN2
NDhBIJ6eARIF2LVqLUjL5tLELxFfjGJE/W8SBSWwgSPnStBaO+o1T0H6TSPCt9Jh
ZIXPg48vqnaQIqd7wDfiyakvTbJoRx2SDLp3SOhXiCA8yq/XtxXRYSvvik75/9sV
kP0g5useJu2nsY90+bErhuh82o9pXFd+nkFenVNo1mEvBEGBWNO0rudTjoD1Ncxn
n2+T2De+/58II/LWzV3r/BEyyj3IePqF9F6yiwIDAQABAoIBAHBEISxKKEL3l/VE
FA8quYwpgcHTBv+NmSRpVTYt1VO7g1HoCW3l1k1EAr7HMpmniViVoiygiIMUTrYB
87tRG+qHl0hlCk68qMl48UXjf0Y/EbZhfOc2g9Gf5FI+BdFOUX4NupdzSEK6zIR0
ltOiVcVZ84GEYymZTBdjZUUGv14iGzfa/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KEY-----
24 changes: 24 additions & 0 deletions test/fixtures/certs/client/chain.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEGDCCAwCgAwIBAgIJAJq8QHkEg5o5MA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNV
BAYTAlVTMQ0wCwYDVQQIEwRVdGFoMQ4wDAYDVQQHEwVQcm92bzEjMCEGA1UEChMa
SW50ZXJuYWwgU2lnbmluZyBBdXRob3JpdHkxEjAQBgNVBAMTCWxvY2FsaG9zdDAe
Fw0xNjEwMTExMjIxNTZaFw0xOTA4MDExMjIxNTZaMGUxCzAJBgNVBAYTAlVTMQ0w
CwYDVQQIEwRVdGFoMQ4wDAYDVQQHEwVQcm92bzEjMCEGA1UEChMaSW50ZXJuYWwg
U2lnbmluZyBBdXRob3JpdHkxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZI
hvcNAQEBBQADggEPADCCAQoCggEBANI3e2jhyAoQOtenmDgqMaulDbd6LxB54+2H
EBZ94868s563HZfW1i9a322Njl8Z8Zs7Hp6X8NANtJeOjbOdocKV7UZ7mhiCirlE
1TeulfwgPbbDdjQ4QSCengESBdi1ai1Iy+bSxC8RX4xiRP1vEgUlsIEj50rQWjvq
NU9B+k0jwrfSYWSFz4OPL6p2kCKne8A34smpL02yaEcdkgy6d0joV4ggPMqv17cV
0WEr74pO+f/bFZD9IObrHibtp7GPdPmxK4bofNqPaVxXfp5BXp1TaNZhLwRBgVjT
tK7nU46A9TXMZ59vk9g3vv+fCCPy1s1d6/wRMso9yHj6hfResosCAwEAAaOByjCB
xzAdBgNVHQ4EFgQUnX++qBGyUBIpJkfIuYLAkS441rwwgZcGA1UdIwSBjzCBjIAU
nX++qBGyUBIpJkfIuYLAkS441ryhaaRnMGUxCzAJBgNVBAYTAlVTMQ0wCwYDVQQI
EwRVdGFoMQ4wDAYDVQQHEwVQcm92bzEjMCEGA1UEChMaSW50ZXJuYWwgU2lnbmlu
ZyBBdXRob3JpdHkxEjAQBgNVBAMTCWxvY2FsaG9zdIIJAJq8QHkEg5o5MAwGA1Ud
EwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBACzI+LS7z3DJDbwczhT4lW+qsexv
avXT7x/Zt2Wv+szjNYRA4LYFGTQ/JYCx9J2zg9Cc6uPxjWlJNjwTVT4WLKJPnuQf
PEEcYp5gJqpHBULdWIEcH9IROpnVQeZETTzLuFLGY6Ya8pA2j6E44pxE8c8wVYuP
RLL8ihFKlEi7iQFjPX8Y0Jq2Xfjo9puldN6Jes3SMQfMuP1MIwiDaTNXeyD4ZBBO
3wDVN4dQHV2Fcq8ES9c5jBKpTkg8a8tFp60WKz+eEAg3mGYkFQNBLyG+S8ZhZef1
VAg3jV1MPjlSw7aGrCkadVwXXOJZmOAlQM5D4NvxnuRwLGCzrBv13q+bDqA=
-----END CERTIFICATE-----
9 changes: 9 additions & 0 deletions test/fixtures/certs/client/pubkey.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA77j88dFqCJiXgigrQAYR
2lt2tlRQqmTo+H/YYwFK0epuaAhVF4qzhoN3pcdbhaVL9+FRLl4DTKq3GtQId6lk
Rf927x/QYfA0FFDZWopg8aQUuC7ka30J8F01xG1/fw0wfMYziE8eQ/p+5sP1O18x
0E4stOL+IM+DltC4vFqis6fpirzWU90Fk23oUh9vJF0Yc8PA4pWm24dBnjYxkT2D
Z+uieI2fXvRf8Yurik0UMPDO+WsOTR1xRVScuDKnq9gePAY6nReUcxX6XcShKEjz
lYeMQca9KFOxYIb6B+DqBQ5SVJnFL2rtWmErL2h+QgU4OV56IVv4IDrDSWR5Wftd
hwIDAQAB
-----END PUBLIC KEY-----
55 changes: 55 additions & 0 deletions test/fixtures/certs/generate-certs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
FQDN='localhost'

# make directories to work from
mkdir -p {server,client,ca,tmp}

# Create your very own Root Certificate Authority
openssl genrsa \
-out ca/my-root-ca.key.pem \
2048

# Self-sign your Root Certificate Authority
# Since this is private, the details can be as bogus as you like
openssl req \
-x509 \
-new \
-nodes \
-key ca/my-root-ca.key.pem \
-days 1024 \
-out ca/my-root-ca.crt.pem \
-subj "/C=US/ST=Utah/L=Provo/O=Internal Signing Authority/CN=${FQDN}"

# Create a Device Certificate for each domain,
# such as example.com, *.example.com, awesome.example.com
# NOTE: You MUST match CN to the domain name or ip address you want to use
openssl genrsa \
-out server/privkey.pem \
2048

# Create a request from your Device, which your Root CA will sign
openssl req -new \
-key server/privkey.pem \
-out tmp/csr.pem \
-subj "/C=US/ST=Utah/L=Provo/O=ACME Tech Inc/CN=${FQDN}"

# Sign the request from Device with your Root CA
# -CAserial ca/my-root-ca.srl
openssl x509 \
-req -in tmp/csr.pem \
-CA ca/my-root-ca.crt.pem \
-CAkey ca/my-root-ca.key.pem \
-CAcreateserial \
-out server/cert.pem \
-days 500

# Create a public key, for funzies
# see https://gist.github.com/coolaj86/f6f36efce2821dfb046d
openssl rsa \
-in server/privkey.pem \
-pubout -out client/pubkey.pem

# Put things in their proper place
rsync -a ca/my-root-ca.crt.pem server/chain.pem
rsync -a ca/my-root-ca.crt.pem client/chain.pem
cat server/cert.pem server/chain.pem > server/fullchain.pem
20 changes: 20 additions & 0 deletions test/fixtures/certs/server/cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDOTCCAiECCQDeQUEpn9zznTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJV
UzENMAsGA1UECBMEVXRhaDEOMAwGA1UEBxMFUHJvdm8xIzAhBgNVBAoTGkludGVy
bmFsIFNpZ25pbmcgQXV0aG9yaXR5MRIwEAYDVQQDEwlsb2NhbGhvc3QwHhcNMTYx
MDExMTIyMTU2WhcNMTgwMjIzMTIyMTU2WjBYMQswCQYDVQQGEwJVUzENMAsGA1UE
CBMEVXRhaDEOMAwGA1UEBxMFUHJvdm8xFjAUBgNVBAoTDUFDTUUgVGVjaCBJbmMx
EjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAO+4/PHRagiYl4IoK0AGEdpbdrZUUKpk6Ph/2GMBStHqbmgIVReKs4aDd6XH
W4WlS/fhUS5eA0yqtxrUCHepZEX/du8f0GHwNBRQ2VqKYPGkFLgu5Gt9CfBdNcRt
f38NMHzGM4hPHkP6fubD9TtfMdBOLLTi/iDPg5bQuLxaorOn6Yq81lPdBZNt6FIf
byRdGHPDwOKVptuHQZ42MZE9g2froniNn170X/GLq4pNFDDwzvlrDk0dcUVUnLgy
p6vYHjwGOp0XlHMV+l3EoShI85WHjEHGvShTsWCG+gfg6gUOUlSZxS9q7VphKy9o
fkIFODleeiFb+CA6w0lkeVn7XYcCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAA307
asNetk+fAJHwsR3xsrP7vPWdb7wAS72ZHWeM/qvuhGlNe4MexWjqbTycDPaN8cvj
WcrhiNg+QdnMuKDu65lZ9BRZm2W1TdCvMIAq69B+bPssbFm7V2XrFALRzfjSmUrw
YYstqJFsM2RxS4kPl+6s6VTyayWgHURofMee1FrUPeWHMlLqgkeVvTDm6NPViYrT
inh4a++/IYh61vCONJqRpyuAn/wYDJD4uOhU4Xp/J/60ZygHvz9hyxjrbUK1cXLW
X7vRnw2GAKnN/KcVjwKYdfXoOFHQeaWsugOVcb9t7mHm+kFrM8lCxUpI4z15h+FV
um/V2RYmCWkOQCddNA==
-----END CERTIFICATE-----
24 changes: 24 additions & 0 deletions test/fixtures/certs/server/chain.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEGDCCAwCgAwIBAgIJAJq8QHkEg5o5MA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNV
BAYTAlVTMQ0wCwYDVQQIEwRVdG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LKJPnuQf
PEEcYp5gJqpHBULdWIEcH9IROpnVQeZETTzLuFLGY6Ya8pA2j6E44pxE8c8wVYuP
RLL8ihFKlEi7iQFjPX8Y0Jq2Xfjo9puldN6Jes3SMQfMuP1MIwiDaTNXeyD4ZBBO
3wDVN4dQHV2Fcq8ES9c5jBKpTkg8a8tFp60WKz+eEAg3mGYkFQNBLyG+S8ZhZef1
VAg3jV1MPjlSw7aGrCkadVwXXOJZmOAlQM5D4NvxnuRwLGCzrBv13q+bDqA=
-----END CERTIFICATE-----
44 changes: 44 additions & 0 deletions test/fixtures/certs/server/fullchain.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-----BEGIN CERTIFICATE-----
MIIDOTCCAiECCQDeQUEpn9zznTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJV
UzENMAsGA1UECBMEVXRhaDEOMAwGA1UEBxMFUHJvdm8xIzAhBgNVBAoTGkludGVy
bmFsIFNpZ25pbmcgQXV0aG9yaXR5MRIwEAYDVQQDEwlsb2NhbGhvc3QwHhcNMTYx
MDExMTIyMTU2WhcNMTgwMjIzMTIyMTU2WjBYMQswCQYDVQQGEwJVUzENMAsGA1UE
CBMEVXRhaDEOMAwGA1UEBxMFUHJvdm8xFjAUBgNVBAoTDUFDTUUgVGVjaCBJbmMx
EjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAO+4/PHRagiYl4IoK0AGEdpbdrZUUKpk6Ph/2GMBStHqbmgIVReKs4aDd6XH
W4WlS/fhUS5eA0yqtxrUCHepZEX/du8f0GHwNBRQ2VqKYPGkFLgu5Gt9CfBdNcRt
f38NMHzGM4hPHkP6fubD9TtfMdBOLLTi/iDPg5bQuLxaorOn6Yq81lPdBZNt6FIf
byRdGHPDwOKVptuHQZ42MZE9g2froniNn170X/GLq4pNFDDwzvlrDk0dcUVUnLgy
p6vYHjwGOp0XlHMV+l3EoShI85WHjEHGvShTsWCG+g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kCKne8A34smpL02yaEcdkgy6d0joV4ggPMqv17cV
0WEr74pO+f/bFZD9IObrHibtp7GPdPmxK4bofNqPaVxXfp5BXp1TaNZhLwRBgVjT
tK7nU46A9TXMZ59vk9g3vv+fCCPy1s1d6/wRMso9yHj6hfResosCAwEAAaOByjCB
xzAdBgNVHQ4EFgQUnX++qBGyUBIpJkfIuYLAkS441rwwgZcGA1UdIwSBjzCBjIAU
nX++qBGyUBIpJkfIuYLAkS441ryhaaRnMGUxCzAJBgNVBAYTAlVTMQ0wCwYDVQQI
EwRVdGFoMQ4wDAYDVQQHEwVQcm92bzEjMCEGA1UEChMaSW50ZXJuYWwgU2lnbmlu
ZyBBdXRob3JpdHkxEjAQBgNVBAMTCWxvY2FsaG9zdIIJAJq8QHkEg5o5MAwGA1Ud
EwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBACzI+LS7z3DJDbwczhT4lW+qsexv
avXT7x/Zt2Wv+szjNYRA4LYFGTQ/JYCx9J2zg9Cc6uPxjWlJNjwTVT4WLKJPnuQf
PEEcYp5gJqpHBULdWIEcH9IROpnVQeZETTzLuFLGY6Ya8pA2j6E44pxE8c8wVYuP
RLL8ihFKlEi7iQFjPX8Y0Jq2Xfjo9puldN6Jes3SMQfMuP1MIwiDaTNXeyD4ZBBO
3wDVN4dQHV2Fcq8ES9c5jBKpTkg8a8tFp60WKz+eEAg3mGYkFQNBLyG+S8ZhZef1
VAg3jV1MPjlSw7aGrCkadVwXXOJZmOAlQM5D4NvxnuRwLGCzrBv13q+bDqA=
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions test/fixtures/certs/server/privkey.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA77j88dFqCJiXgigrQAYR2lt2tlRQqmTo+H/YYwFK0epuaAhV
F4qzhoN3pcdbhaVL9+FRLl4DTKq3GtQId6lkRf927x/QYfA0FFDZWopg8aQUuC7k
a30J8F01xG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6X6fc2GHgxEINYC1BnrIsHfFxw
yC8EqnGHg4SW6zcJGO1kaQKBgA/ZZKbf1X6n8gdWB81zWxjL2O1ELtHL+HToy0OR
JJDgN2rvrTi3otUJe5VX+CUjzgPP+LLUGgZt/HZpWeyZFVkeaoPocKMyzE4uGnKK
7CZLj9Ufr+f+5ha4a+Uskuop9h/BE7woWYmU8hziSWxA9YCy7/Buif4ZLN9JTCEI
4BBvAoGAckWRKbnXG7KS4+XkmuHpeHL/+4T6Odp+0FrhSaQqkmhKEc8BR2BMEFU+
aF5YARrEr++CZloItaVHnNmRLkFgVQfkaKMfDa1fs/0rm4c1htdZsJJQUiBTojh+
zJu+hlPRqIN57Zrx6n63zJFdECk4fEpfrkdyWV/iBfzsn+/0BWE=
-----END RSA PRIVATE KEY-----
75 changes: 75 additions & 0 deletions test/fixtures/client/filters-https.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"private": [
{
"path": "/echo-param/${param}",
"method": "GET",
"origin": "https://localhost:${originPort}"
},

{
"path": "/echo-body",
"method": "POST",
"origin": "https://localhost:${originPort}"
},

{
"path": "/echo-body/filtered",
"method": "POST",
"origin": "https://localhost:${originPort}",
"valid": [
{
"//": "accept requests with 'proxy.*: please' in their body",
"path": "proxy.*",
"value": "please"
}
]
},

{
"path": "/echo-headers",
"method": "POST",
"origin": "https://localhost:${originPort}"
},

{
"path": "/echo-query",
"method": "GET",
"origin": "https://localhost:${originPort}"
}

],
"public": [
{
"path": "/echo-param/${param}",
"method": "GET"
},

{
"path": "/echo-body",
"method": "POST"
},

{
"path": "/echo-body/filtered",
"method": "POST",
"valid": [
{
"//": "accept requests with 'proxy.*: please' in their body",
"path": "proxy.*",
"value": "please"
}
]
},

{
"path": "/echo-headers",
"method": "POST"
},

{
"path": "/echo-query",
"method": "GET"
}

]
}
Loading

0 comments on commit 97469ee

Please sign in to comment.