-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Sync eng/common directory with azure-sdk-tools for PR 15515 #46748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 @@ | ||
| *.csr | ||
| *.key | ||
| *.srl |
This file contains hidden or 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,17 @@ | ||
| # Configuration for the self-signed CA used to sign the localhost TLS certificate. | ||
| # Parameters are kept in sync with the original dotnet-devcert.crt so that | ||
| # dotnet dev-certs and other tooling recognises the certificate chain. | ||
|
|
||
| [req] | ||
| prompt = no | ||
| default_bits = 2048 | ||
| distinguished_name = subject | ||
| x509_extensions = x509_ext | ||
|
|
||
| [ subject ] | ||
| commonName = Azure SDK | ||
|
|
||
| [x509_ext] | ||
| basicConstraints = critical, CA:true | ||
| keyUsage = critical, keyCertSign, cRLSign | ||
| subjectKeyIdentifier = hash |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,21 +1,18 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIDZzCCAk+gAwIBAgIUXUCvBB5U6rY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
| yAQQZjG2XNh110z3orEhF7k/3VtuF9T2zW1Sc2kpy90iNR3a28C48wKnfJuQ63/D | ||
| W2FUtNVII0kLyVP6F457rodZ1Ih++Zr2IS4OxYew0jDqW3mG7govmj1G286sjbSp | ||
| v6RUMq0dIm4eQ/xz63CCtpZKDf2mIEXapJq3Y2qDTO+jmqIjCvlb1vg3CFs= | ||
| -----END CERTIFICATE----- |
Binary file not shown.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,23 +1,26 @@ | ||
| # TLS certificate configuration for the localhost leaf certificate. | ||
| # This cert is signed by the self-signed CA defined in ca.conf. | ||
|
|
||
| [req] | ||
| prompt = no | ||
| default_bits = 2048 | ||
| distinguished_name = subject | ||
| req_extensions = req_ext | ||
| x509_extensions = x509_ext | ||
|
|
||
| [ subject ] | ||
| [subject] | ||
| commonName = localhost | ||
|
|
||
| [req_ext] | ||
| basicConstraints = critical, CA:true | ||
| basicConstraints = critical, CA:false | ||
| subjectAltName = @alt_names | ||
|
|
||
| [x509_ext] | ||
| basicConstraints = critical, CA:true | ||
| keyUsage = critical, keyCertSign, cRLSign, digitalSignature,keyEncipherment | ||
| basicConstraints = critical, CA:false | ||
| keyUsage = critical, digitalSignature, keyEncipherment | ||
| extendedKeyUsage = critical, serverAuth | ||
| subjectAltName = critical, @alt_names | ||
| 1.3.6.1.4.1.311.84.1.1 = ASN1:UTF8String:ASP.NET Core HTTPS development certificate # Needed to get it imported by dotnet dev-certs | ||
| 1.3.6.1.4.1.311.84.1.1 = ASN1:UTF8String:ASP.NET Core HTTPS development certificate # Needed to get it imported by dotnet dev-certs | ||
|
|
||
| [alt_names] | ||
| DNS.1 = localhost |
This file contains hidden or 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,21 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIDdzCCAl+gAwIBAgIUdURcL17NeFzznnxY1Bcx5Jl4WYIwDQYJKoZIhvcNAQEL | ||
| BQAwFDESMBAGA1UEAwwJQXp1cmUgU0RLMB4XDTI2MDUwNjAzMzYzMVoXDTI3MDUw | ||
| NjAzMzYzMVowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF | ||
| AAOCAQ8AMIIBCgKCAQEA2kzmhldqDQRPbsze56o2UsTImNfh55MkbHrZkt/lASXX | ||
| zJn33M4L+rIRFrwBiG8ruI1sOCNyQcgXaayx/F5suYOjAE2qwQSxSgrILe96upDO | ||
| M5H3syVCSsd+oThlD0BnrxYYUOvY6cQCw96pthFiR4rRYv/fiMPLQmkoD2FUXHy/ | ||
| ZY6KD+oAKybKfbosh3LqPBKF6R7/Xcxt4GFwkh8rl+HTgSMRvrjAheh8HJ5k0xVF | ||
| Mv4OPUTRIvFwBlLW6oxbMEMUt3TNhvjkOyUlf5XRXNRLy7DNEw7WcwuEnzC+X2HK | ||
| ideAYhAOQJWjkaiPkaNn9vrTwitLxu0KAbHY+lhSXwIDAQABo4HAMIG9MA4GA1Ud | ||
| DwEB/wQEAwIFoDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDATAXBgNVHREBAf8EDTAL | ||
| gglsb2NhbGhvc3QwOgYKKwYBBAGCN1QBAQQsDCpBU1AuTkVUIENvcmUgSFRUUFMg | ||
| ZGV2ZWxvcG1lbnQgY2VydGlmaWNhdGUwHQYDVR0OBBYEFFOSvaEPxxURdZAsFk4j | ||
| d3WcEJ/pMB8GA1UdIwQYMBaAFJPFKH87Z11sSFO+1fFsa+l19MO1MA0GCSqGSIb3 | ||
| DQEBCwUAA4IBAQBwHqrqN83moN4PjACwFL0auY4U+3Y9x8AQ0dTMHd5Dy20461uw | ||
| 5Y3ZCkGNlsqiuzeSWRZMzQ6oW8qO/Hd/yZmi7sORDOa0UVL6yQcllTivFvfPFAhf | ||
| Wc2bHrS+CJnhX8Lwk15MWoCqV5CrcK4XkPuWoRfMDkuiLYGyW94zNfv3LnKJeBh5 | ||
| NpVvXgPVmASJehUvhL5/NAnrME8RupzNbmkWP8rhpTG1M8wfBtJV3oJtlukXCPvR | ||
| fLW/zgL3XTNGqtnUX567qaSaJ7lvOsaB7CF+E14u21hYpAJ+Ex822aKF0VNGeTc3 | ||
| gIp2IQgFBxDGSiQe0ZKmaf1QgW+Yl+u5E85E | ||
| -----END CERTIFICATE----- |
This file contains hidden or 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,100 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| # Generates a self-signed CA and a TLS certificate for localhost signed by that CA, | ||
| # then packages them into a PKCS#12 (PFX) file for use with the test proxy. | ||
| # | ||
| # Usage: ./rotate.sh [--days <n>] [--password <pass>] | ||
| # --days Validity period in days (default: 365) | ||
| # --password Password for the PFX file (default: password, matching apply-dev-cert.sh) | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| DAYS=365 | ||
| PFX_PASSWORD="password" | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --days) | ||
| DAYS="$2" | ||
| shift 2 | ||
| ;; | ||
| --password) | ||
| PFX_PASSWORD="$2" | ||
| shift 2 | ||
| ;; | ||
| *) | ||
| echo "Unknown argument: $1" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| CA_KEY="$SCRIPT_DIR/ca.key" | ||
| # dotnet-devcert.crt is the CA public cert installed into trust stores by apply-dev-cert.sh. | ||
| CA_CERT="$SCRIPT_DIR/dotnet-devcert.crt" | ||
| CA_CONF="$SCRIPT_DIR/ca.conf" | ||
|
|
||
| TLS_KEY="$SCRIPT_DIR/dotnet-devcert.key" | ||
| TLS_CSR="$SCRIPT_DIR/dotnet-devcert.csr" | ||
| TLS_CERT="$SCRIPT_DIR/localhost.crt" | ||
| TLS_PFX="$SCRIPT_DIR/dotnet-devcert.pfx" | ||
| TLS_CONF="$SCRIPT_DIR/localhost.conf" | ||
|
|
||
| echo "Generating CA private key..." | ||
| openssl genrsa -out "$CA_KEY" 2048 | ||
|
|
||
| echo "Generating self-signed CA certificate (${DAYS} days)..." | ||
| openssl req -new -x509 \ | ||
| -key "$CA_KEY" \ | ||
| -out "$CA_CERT" \ | ||
| -days "$DAYS" \ | ||
| -config "$CA_CONF" | ||
|
|
||
| echo "Generating TLS private key..." | ||
| openssl genrsa -out "$TLS_KEY" 2048 | ||
|
|
||
| echo "Generating TLS certificate signing request..." | ||
| openssl req -new \ | ||
| -key "$TLS_KEY" \ | ||
| -out "$TLS_CSR" \ | ||
| -config "$TLS_CONF" | ||
|
|
||
| echo "Signing TLS certificate with CA (${DAYS} days)..." | ||
| openssl x509 -req \ | ||
| -in "$TLS_CSR" \ | ||
| -CA "$CA_CERT" \ | ||
| -CAkey "$CA_KEY" \ | ||
| -CAcreateserial \ | ||
| -out "$TLS_CERT" \ | ||
| -days "$DAYS" \ | ||
| -extfile "$TLS_CONF" \ | ||
| -extensions x509_ext | ||
|
|
||
| echo "Creating PFX bundle (TLS cert + CA chain + private key)..." | ||
| openssl pkcs12 -export \ | ||
| -out "$TLS_PFX" \ | ||
| -inkey "$TLS_KEY" \ | ||
| -in "$TLS_CERT" \ | ||
| -certfile "$CA_CERT" \ | ||
| -password "pass:${PFX_PASSWORD}" | ||
|
|
||
| # Remove OpenSSL serial number tracking file; it is regenerated on each run. | ||
| rm -f "$SCRIPT_DIR/dotnet-devcert.srl" | ||
|
|
||
| echo "" | ||
| echo "Created files:" | ||
| echo " $CA_CERT (CA public cert — install this into trust stores)" | ||
| echo " $TLS_CERT" | ||
| echo " $TLS_CSR" | ||
| echo " $TLS_PFX (CA public cert + TLS public cert + TLS private key)" | ||
| echo "" | ||
| echo "Private keys (gitignored — do not commit):" | ||
| echo " $CA_KEY" | ||
| echo " $TLS_KEY" | ||
| echo "" | ||
| echo "Run apply-dev-cert.sh to install the certificates into your trust stores." | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.