Skip to content

Commit

Permalink
Merge pull request #503 from srvrco/DUAL_RSA_ECDSA_ACMEv2
Browse files Browse the repository at this point in the history
Fixes for DUAL_RSA_ECDSA and ecliptic curve problems
  • Loading branch information
timkimber authored Feb 12, 2020
2 parents 621d783 + e0626f3 commit 21d5a21
Show file tree
Hide file tree
Showing 9 changed files with 1,800 additions and 1,565 deletions.
3,138 changes: 1,579 additions & 1,559 deletions getssl

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions test/3-dual-rsa-ecdsa.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/env bats

load '/bats-support/load.bash'
load '/bats-assert/load.bash'
load '/getssl/test/test_helper.bash'


# This is run for every test
setup() {
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
}


@test "Create dual certificates using HTTP-01 verification" {
CONFIG_FILE="getssl-http01-dual-rsa-ecdsa.cfg"
setup_environment
init_getssl
create_certificate
assert_success
}


@test "Force renewal of dual certificates using HTTP-01" {
#!FIXME test certificate has been updated
run ${CODE_DIR}/getssl -f $GETSSL_HOST
assert_success
}

@test "Create dual certificates using DNS-01 verification" {
CONFIG_FILE="getssl-dns01-dual-rsa-ecdsa.cfg"
setup_environment
init_getssl
create_certificate
assert_success
}


@test "Force renewal of dual certificates using DNS-01" {
#!FIXME test certificate has been updated
run ${CODE_DIR}/getssl -f $GETSSL_HOST
assert_success
cleanup_environment
}
41 changes: 41 additions & 0 deletions test/5-secp384-http01.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! /usr/bin/env bats

load '/bats-support/load.bash'
load '/bats-assert/load.bash'
load '/getssl/test/test_helper.bash'


# This is run for every test
setup() {
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
}


@test "Create new secp384r1 certificate using HTTP-01 verification" {
CONFIG_FILE="getssl-http01-secp384.cfg"
setup_environment
init_getssl
create_certificate
assert_success
}


@test "Force renewal of secp384r1 certificate using HTTP-01" {
run ${CODE_DIR}/getssl -f $GETSSL_HOST
assert_success
}


@test "Create new secp521r1 certificate using HTTP-01 verification" {
CONFIG_FILE="getssl-http01-secp521.cfg"
setup_environment
init_getssl
create_certificate
assert_success
}


@test "Force renewal of secp521r1 certificate using HTTP-01" {
run ${CODE_DIR}/getssl -f $GETSSL_HOST
assert_success
}
3 changes: 0 additions & 3 deletions test/Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ WORKDIR /root
RUN mkdir /etc/nginx/pki
RUN mkdir /etc/nginx/pki/private

# Prevent "Can't load /root/.rnd into RNG" error from openssl
# RUN touch /root/.rnd

# BATS (Bash Automated Testings)
RUN git clone https://github.com/bats-core/bats-core.git /bats-core
RUN git clone https://github.com/jasonkarns/bats-support /bats-support
Expand Down
6 changes: 3 additions & 3 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ docker exec -it getssl-ubuntu18 /getssl/test/debug-test.sh getssl-http01.cfg

## TODO

1. Test RHEL6, Debian as well
2. Test SSH, SFTP
3. Test wildcards
1. Test wildcards
2. Test SSH, SFTP, SCP
3. Test change of key algorithm
37 changes: 37 additions & 0 deletions test/test-config/getssl-dns01-dual-rsa-ecdsa.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Uncomment and modify any variables you need
# see https://github.com/srvrco/getssl/wiki/Config-variables for details
# see https://github.com/srvrco/getssl/wiki/Example-config-files for example configs
#
CA="https://pebble:14000/dir"

VALIDATE_VIA_DNS=true
DNS_ADD_COMMAND="/getssl/dns_scripts/dns_add_challtestsrv"
DNS_DEL_COMMAND="/getssl/dns_scripts/dns_del_challtestsrv"

DUAL_RSA_ECDSA="true"
ACCOUNT_KEY_TYPE="prime256v1"
PRIVATE_KEY_ALG="prime256v1"

# Additional domains - this could be multiple domains / subdomains in a comma separated list
SANS=""

# Acme Challenge Location. The first line for the domain, the following ones for each additional domain.
ACL=('/var/www/html/.well-known/acme-challenge')

#Set USE_SINGLE_ACL="true" to use a single ACL for all checks
USE_SINGLE_ACL="false"

# Location for all your certs, these can either be on the server (full path name)
# or using ssh /sftp as for the ACL
DOMAIN_CERT_LOCATION="/etc/nginx/pki/server.crt"
DOMAIN_KEY_LOCATION="/etc/nginx/pki/private/server.key"
CA_CERT_LOCATION="/etc/nginx/pki/chain.crt"
DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert

# The command needed to reload apache / nginx or whatever you use
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && /getssl/test/restart-nginx"

# Define the server type and confirm correct certificate is installed
SERVER_TYPE="https"
CHECK_REMOTE="true"
33 changes: 33 additions & 0 deletions test/test-config/getssl-http01-dual-rsa-ecdsa.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Uncomment and modify any variables you need
# see https://github.com/srvrco/getssl/wiki/Config-variables for details
# see https://github.com/srvrco/getssl/wiki/Example-config-files for example configs
#
CA="https://pebble:14000/dir"

DUAL_RSA_ECDSA="true"
ACCOUNT_KEY_TYPE="prime256v1"
PRIVATE_KEY_ALG="prime256v1"

# Additional domains - this could be multiple domains / subdomains in a comma separated list
SANS=""

# Acme Challenge Location.
ACL=('/var/www/html/.well-known/acme-challenge')

#Set USE_SINGLE_ACL="true" to use a single ACL for all checks
USE_SINGLE_ACL="false"

# Location for all your certs, these can either be on the server (full path name)
# or using ssh /sftp as for the ACL
DOMAIN_CERT_LOCATION="/etc/nginx/pki/server.crt"
DOMAIN_KEY_LOCATION="/etc/nginx/pki/private/server.key"
CA_CERT_LOCATION="/etc/nginx/pki/chain.crt"
DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert

# The command needed to reload apache / nginx or whatever you use
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && /getssl/test/restart-nginx"

# Define the server type and confirm correct certificate is installed
SERVER_TYPE="https"
CHECK_REMOTE="true"
32 changes: 32 additions & 0 deletions test/test-config/getssl-http01-secp384.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Uncomment and modify any variables you need
# see https://github.com/srvrco/getssl/wiki/Config-variables for details
# see https://github.com/srvrco/getssl/wiki/Example-config-files for example configs
#
CA="https://pebble:14000/dir"

ACCOUNT_KEY_TYPE="secp384r1"
PRIVATE_KEY_ALG="secp384r1"

# Additional domains - this could be multiple domains / subdomains in a comma separated list
SANS=""

# Acme Challenge Location.
ACL=('/var/www/html/.well-known/acme-challenge')

#Set USE_SINGLE_ACL="true" to use a single ACL for all checks
USE_SINGLE_ACL="false"

# Location for all your certs, these can either be on the server (full path name)
# or using ssh /sftp as for the ACL
DOMAIN_CERT_LOCATION="/etc/nginx/pki/server.crt"
DOMAIN_KEY_LOCATION="/etc/nginx/pki/private/server.key"
CA_CERT_LOCATION="/etc/nginx/pki/chain.crt"
DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert

# The command needed to reload apache / nginx or whatever you use
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && /getssl/test/restart-nginx"

# Define the server type and confirm correct certificate is installed
SERVER_TYPE="https"
CHECK_REMOTE="true"
32 changes: 32 additions & 0 deletions test/test-config/getssl-http01-secp521.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Uncomment and modify any variables you need
# see https://github.com/srvrco/getssl/wiki/Config-variables for details
# see https://github.com/srvrco/getssl/wiki/Example-config-files for example configs
#
CA="https://pebble:14000/dir"

ACCOUNT_KEY_TYPE="secp521r1"
PRIVATE_KEY_ALG="secp521r1"

# Additional domains - this could be multiple domains / subdomains in a comma separated list
SANS=""

# Acme Challenge Location.
ACL=('/var/www/html/.well-known/acme-challenge')

#Set USE_SINGLE_ACL="true" to use a single ACL for all checks
USE_SINGLE_ACL="false"

# Location for all your certs, these can either be on the server (full path name)
# or using ssh /sftp as for the ACL
DOMAIN_CERT_LOCATION="/etc/nginx/pki/server.crt"
DOMAIN_KEY_LOCATION="/etc/nginx/pki/private/server.key"
CA_CERT_LOCATION="/etc/nginx/pki/chain.crt"
DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert

# The command needed to reload apache / nginx or whatever you use
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && /getssl/test/restart-nginx"

# Define the server type and confirm correct certificate is installed
SERVER_TYPE="https"
CHECK_REMOTE="true"

0 comments on commit 21d5a21

Please sign in to comment.