Skip to content

Commit dcaf423

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/gh-windows' into gh-windows
2 parents 45f232b + 4e2db11 commit dcaf423

File tree

4 files changed

+61
-3
lines changed

4 files changed

+61
-3
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
run: |
7878
echo "::set-env name=ZERONET_OPENSSL_BIN::$((Get-Command openssl).definition)"
7979
openssl version -a
80-
openssl rand -hex 256
80+
python run.py
8181
8282
- name: Test
8383
run: |

openssl.cnf

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[ req ]
2+
default_bits = 2048
3+
default_keyfile = server-key.pem
4+
distinguished_name = subject
5+
req_extensions = req_ext
6+
x509_extensions = x509_ext
7+
string_mask = utf8only
8+
9+
# The Subject DN can be formed using X501 or RFC 4514 (see RFC 4519 for a description).
10+
# Its sort of a mashup. For example, RFC 4514 does not provide emailAddress.
11+
[ subject ]
12+
countryName = US
13+
stateOrProvinceName = NY
14+
localityName = New York
15+
organizationName = Example, LLC
16+
17+
# Use a friendly name here because its presented to the user. The server's DNS
18+
# names are placed in Subject Alternate Names. Plus, DNS names here is deprecated
19+
# by both IETF and CA/Browser Forums. If you place a DNS name here, then you
20+
# must include the DNS name in the SAN too (otherwise, Chrome and others that
21+
# strictly follow the CA/Browser Baseline Requirements will fail).
22+
commonName = Example Company
23+
24+
emailAddress = test@example.com
25+
26+
# Section x509_ext is used when generating a self-signed certificate. I.e., openssl req -x509 ...
27+
[ x509_ext ]
28+
29+
subjectKeyIdentifier = hash
30+
authorityKeyIdentifier = keyid,issuer
31+
32+
basicConstraints = CA:FALSE
33+
keyUsage = digitalSignature, keyEncipherment
34+
extendedKeyUsage = clientAuth, serverAuth
35+
subjectAltName = @alternate_names
36+
37+
# RFC 5280, Section 4.2.1.12 makes EKU optional
38+
# CA/Browser Baseline Requirements, Appendix (B)(3)(G) makes me confused
39+
# extendedKeyUsage = serverAuth, clientAuth
40+
41+
# Section req_ext is used when generating a certificate signing request. I.e., openssl req ...
42+
[ req_ext ]
43+
44+
subjectKeyIdentifier = hash
45+
46+
basicConstraints = CA:FALSE
47+
keyUsage = digitalSignature, keyEncipherment
48+
extendedKeyUsage = clientAuth, serverAuth
49+
subjectAltName = @alternate_names
50+
51+
# RFC 5280, Section 4.2.1.12 makes EKU optional
52+
# CA/Browser Baseline Requirements, Appendix (B)(3)(G) makes me confused
53+
# extendedKeyUsage = serverAuth, clientAuth
54+
55+
[ alternate_names ]
56+
57+
DNS.1 = python.org
58+
DNS.2 = www.python.org

run.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import subprocess
2+
subprocess.run("""openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -config openssl.cnf -subj "/C=US/O=Amazon/OU=Server CA 1B/CN=Amazon" -keyout cakey-rsa.pem -out cacert-rsa.pem -batch""", shell=True)

src/Crypt/CryptConnection.py

-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ def createSslRsaCert(self):
158158
proc.wait()
159159
print(back)
160160

161-
print(subprocess.run(self.openssl_bin + " rand -hex 65536", shell=True, stdout=subprocess.PIPE).stdout.decode(errors="replace"))
162-
163161
if not (os.path.isfile(self.cacert_pem) and os.path.isfile(self.cakey_pem)):
164162
self.log.error("RSA ECC SSL CAcert generation failed, CAcert or CAkey files not exist. (%s)" % back)
165163
return False

0 commit comments

Comments
 (0)