-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from tmaher/tls-verify-hostnames
enable TLS hostname validation
- Loading branch information
Showing
13 changed files
with
629 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
BASE_PATH=$( cd "`dirname $0`/../test/fixtures/ca" && pwd ) | ||
cd "${BASE_PATH}" || exit 4 | ||
|
||
USAGE=$( cat << EOS | ||
Usage: | ||
$0 --regenerate | ||
Generates a new self-signed CA, for integration testing. This should only need | ||
to be run if you are writing new TLS/SSL tests, and need to generate | ||
additional fixtuer CAs. | ||
This script uses the GnuTLS certtool CLI. If you are on macOS, | ||
'brew install gnutls', and it will be installed as 'gnutls-certtool'. | ||
Apple unfortunately ships with an incompatible /usr/bin/certtool that does | ||
different things. | ||
EOS | ||
) | ||
|
||
if [ "x$1" != 'x--regenerate' ]; then | ||
echo "${USAGE}" | ||
exit 1 | ||
fi | ||
|
||
TOOL=`type -p certtool` | ||
if [ "$(uname)" = "Darwin" ]; then | ||
TOOL=`type -p gnutls-certtool` | ||
if [ ! -x "${TOOL}" ]; then | ||
echo "Sorry, Darwin requires gnutls-certtool; try `brew install gnutls`" | ||
exit 2 | ||
fi | ||
fi | ||
|
||
if [ ! -x "${TOOL}" ]; then | ||
echo "Sorry, no certtool found!" | ||
exit 3 | ||
fi | ||
export TOOL | ||
|
||
|
||
${TOOL} --generate-privkey > ./cakey.pem | ||
${TOOL} --generate-self-signed \ | ||
--load-privkey ./cakey.pem \ | ||
--template ./ca.info \ | ||
--outfile ./cacert.pem | ||
|
||
echo "cert and private key generated! Don't forget to check them in" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cn = rubyldap | ||
ca | ||
cert_signing_key | ||
expiration_days = 7200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIID7zCCAlegAwIBAgIMV7zWei6SNfABx6jMMA0GCSqGSIb3DQEBCwUAMBMxETAP | ||
BgNVBAMTCHJ1YnlsZGFwMB4XDTE2MDgyMzIzMDQyNloXDTM2MDUxMDIzMDQyNlow | ||
EzERMA8GA1UEAxMIcnVieWxkYXAwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGK | ||
AoIBgQDGe9wziGHZJhIf+IEKSk1tpT9Mu7YgsUwjrlutvkoO1Q6K+amTAVDXizPf | ||
1DVSDpZP5+CfBOznhgLMsPvrQ02w4qx5/6X9L+zJcMk8jTNYSKj5uIKpK52E7Uok | ||
aygMXeaqroPONGkoJIZiVGgdbWfTvcffTm8FOhztXUbMrMXJNinFsocGHEoMNN8b | ||
vqgAyG4+DFHoK4L0c6eQjE4nZBChieZdShUhaBpV7r2qSNbPw67cvAKuEzml58mV | ||
1ZF1F73Ua8gPWXH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