Skip to content

Commit

Permalink
Generated certificates fail, investigating.
Browse files Browse the repository at this point in the history
Certificates from SmtpClient work, but generated ones do not.
  • Loading branch information
mikee47 committed Jun 5, 2024
1 parent 5a800ad commit a4e9337
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sming/Components/ssl/Tools/make_certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
# Generate the certificates and keys for testing.
#

set -v

PROJECT_NAME="Sming Project"

# Generate the openssl configuration files.
Expand Down Expand Up @@ -144,7 +146,7 @@ date -s "$DATE_NOW"
touch x509_bad_before.pem
fi
openssl x509 -req -in x509_512.req -out x509_bad_after.pem \
-sha1 -CAcreateserial -days -365 \
-sha1 -CAcreateserial -days 365 \
-CA ca_x509.pem -CAkey ca_key.pem

# some cleanup
Expand All @@ -168,9 +170,9 @@ openssl pkcs8 -in key_512.pem -nocrypt -topk8 -out unencrypted_pem.p8
openssl pkcs8 -in key_512.pem -nocrypt -topk8 -outform DER -out unencrypted.p8

# generate pkcs12 files (use RC4-128 for encryption)
openssl pkcs12 -export -in x509_1024.pem -inkey key_1024.pem -certfile ca_x509.pem -keypbe PBE-SHA1-RC4-128 -certpbe PBE-SHA1-RC4-128 -name "p12_with_CA" -out withCA.p12 -password pass:abcd
openssl pkcs12 -export -in x509_1024.pem -inkey key_1024.pem -keypbe PBE-SHA1-RC4-128 -certpbe PBE-SHA1-RC4-128 -name "p12_without_CA" -out withoutCA.p12 -password pass:abcd
openssl pkcs12 -export -in x509_1024.pem -inkey key_1024.pem -keypbe PBE-SHA1-RC4-128 -certpbe PBE-SHA1-RC4-128 -out noname.p12 -password pass:abcd
openssl pkcs12 -legacy -export -in x509_1024.pem -inkey key_1024.pem -certfile ca_x509.pem -keypbe PBE-SHA1-RC4-128 -certpbe PBE-SHA1-RC4-128 -name "p12_with_CA" -out withCA.p12 -password pass:abcd
openssl pkcs12 -legacy -export -in x509_1024.pem -inkey key_1024.pem -keypbe PBE-SHA1-RC4-128 -certpbe PBE-SHA1-RC4-128 -name "p12_without_CA" -out withoutCA.p12 -password pass:abcd
openssl pkcs12 -legacy -export -in x509_1024.pem -inkey key_1024.pem -keypbe PBE-SHA1-RC4-128 -certpbe PBE-SHA1-RC4-128 -out noname.p12 -password pass:abcd

# PEM certificate chain
cat ca_x509.pem >> x509_device.pem
Expand Down

0 comments on commit a4e9337

Please sign in to comment.