-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test with a static test cert and keystore instead of generating a new…
… one each run
- Loading branch information
Showing
9 changed files
with
118 additions
and
230 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
163 changes: 0 additions & 163 deletions
163
src/main/java/jenkins/test/https/SelfSignedCertificates.java
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
src/main/java/jenkins/test/https/SelfSignedCertificatesException.java
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
cd "$(dirname "$0")/../.." | ||
|
||
tmpDir=$(mktemp -d) | ||
trap 'rm -rf $tmpDir' EXIT | ||
|
||
cat > "$tmpDir/req.cnf" <<EOF | ||
[ req ] | ||
default_bits = 2048 | ||
prompt = no | ||
distinguished_name = req_distinguished_name | ||
x509_extensions = req_ext | ||
[ req_distinguished_name ] | ||
countryName = US | ||
stateOrProvinceName = NY | ||
localityName = New York | ||
organizationName = Jenkins | ||
organizationalUnitName = Test | ||
commonName = Self-Signed CA | ||
emailAddress = [email protected] | ||
[ req_ext ] | ||
keyUsage = digitalSignature | ||
basicConstraints = CA:false | ||
subjectAltName = @alternate_names | ||
subjectKeyIdentifier = hash | ||
[ alternate_names ] | ||
DNS.1 = localhost | ||
EOF | ||
|
||
mkdir -p "$tmpDir/output" | ||
key="$tmpDir/output/key.pem" | ||
cert="$tmpDir/output/cert.pem" | ||
certP12="$tmpDir/output/cert.p12" | ||
# Generate a self-signed cert valid for 100 years | ||
echo "Generate self-signed cert for localhost for 100 years" | ||
openssl req -newkey rsa:2048 -nodes -keyout "$key" -x509 -days 36500 -out "$cert" -config "$tmpDir/req.cnf" | ||
echo "Generate PKCS12 keystore" | ||
openssl pkcs12 -inkey "$key" -in "$cert" -export -out "$certP12" -passout pass:changeit -passin pass:changeit | ||
echo "Copying generated resources to src/main/resources" | ||
mkdir -p src/main/resources/https | ||
cp "$cert" src/main/resources/https/test-cert.pem | ||
cp "$certP12" src/main/resources/https/test-keystore.p12 |
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----- | ||
MIID8zCCAtugAwIBAgIUOjlbXGGFXddBZvQRZT2GFs6QDEswDQYJKoZIhvcNAQEL | ||
BQAwgYoxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOWTERMA8GA1UEBwwITmV3IFlv | ||
cmsxEDAOBgNVBAoMB0plbmtpbnMxDTALBgNVBAsMBFRlc3QxFzAVBgNVBAMMDlNl | ||
bGYtU2lnbmVkIENBMSEwHwYJKoZIhvcNAQkBFhJub3JlcGx5QGplbmtpbnMuaW8w | ||
HhcNMjQxMDEwMTE1OTU5WhcNMjUxMDEwMTE1OTU5WjCBijELMAkGA1UEBhMCVVMx | ||
CzAJBgNVBAgMAk5ZMREwDwYDVQQHDAhOZXcgWW9yazEQMA4GA1UECgwHSmVua2lu | ||
czENMAsGA1UECwwEVGVzdDEXMBUGA1UEAwwOU2VsZi1TaWduZWQgQ0ExITAfBgkq | ||
hkiG9w0BCQEWEm5vcmVwbHlAamVua2lucy5pbzCCASIwDQYJKoZIhvcNAQEBBQAD | ||
ggEPADCCAQoCggEBAJ7L6c7X/KcHpqGmh6X3ibvJfHi30bVbzu6WzYWnNxBmGby1 | ||
kH4kTRntlUqV3r82kIEImBuxVgpN3zA0HrFL10YzQuFEmq7ENGmC5rwkN2bgzwSP | ||
3GubKkIilNtt0b8jYIhXBpTnurA6lkfRnJufIXcCJQUt1XKABk06QrgEozWNmmtF | ||
eRT/O8ZIUYbN2SKVAJzw+eUH2jJueU3Px4JBzsCH3FIHm0hns7FzfD1ii3BIXsjc | ||
H6t6XXpUBlfaMPogVcdznVy47NDcT/nuNCqFMtZlg6qXDiYKSM2yKVwECsEBXskS | ||
MD3FgDMaVEv/zdW97YAO83jNMFSMf2GVfB8gFEkCAwEAAaNPME0wCwYDVR0PBAQD | ||
AgeAMAkGA1UdEwQCMAAwFAYDVR0RBA0wC4IJbG9jYWxob3N0MB0GA1UdDgQWBBTG | ||
aPVOHhY0gS/TqdEHVJG9mr47TzANBgkqhkiG9w0BAQsFAAOCAQEAcd/lMAhdqTnD | ||
3NQ3nIFvxXBs/Y0938AmGNNbLix3qTYFGVAIrCXQQFgXYO+WvowL/DRPPxdjB960 | ||
5SC9AkRLi0gKS9OEio20FrVCnT1j5wjdMlb9idK/VxLJg6toGp1jUbuSFBnrhFSs | ||
LXRSYPGNXoaGYs2/YBKlP2W7+pqin8VXbFBauhhi+xqVLBDq5zo2Lwnj4y22UmBF | ||
QO4ucQ2K4q0wh5PcM3iUxWfgZ/HxIcBiZvyJHklcaPteRuWF/40irRo//WkGzJOZ | ||
w6nk5TtixTKnWrHU9kvZouwtYx7K4TJ/VXy5mfuLtmM09PumgQAVdqNPplJ17fIP | ||
W9YzDpAmwA== | ||
-----END CERTIFICATE----- |
Binary file not shown.
Oops, something went wrong.