Skip to content
This repository was archived by the owner on Aug 3, 2022. It is now read-only.

Commit 39ed434

Browse files
authored
Merge pull request #92 from sleevi/wpr_fix_two
Explicitly set the version to X.509v3
2 parents 538d30f + 5b600a1 commit 39ed434

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ code](https://docs.google.com/document/d/1cehHn3Lig7UYw_7pqQJjkbPTV3kS11EYwjKO-6
2525
If you find issues with the project, you can file issues on this repo.
2626
If you want to do more and contribute code to help the project evolve,
2727
check out our [contribution
28-
guidelines](documentation/Contributing.md).
28+
guidelines](documentation/Contributing.md).

certutils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def generate_cert(root_ca_cert_str, server_cert_str, server_host):
240240
ca_key = load_privatekey(root_ca_cert_str)
241241

242242
cert = crypto.X509()
243+
cert.set_version(2)
243244
cert.get_subject().CN = common_name
244245
cert.gmtime_adj_notBefore(-60 * 60)
245246
cert.gmtime_adj_notAfter(60 * 60 * 24 * 30)

certutils_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test_generate_cert(self):
129129
cert = certutils.load_cert(cert_string)
130130
self.assertEqual(issuer, cert.get_issuer().commonName)
131131
self.assertEqual(subject, cert.get_subject().commonName)
132+
self.assertEqual(2, cert.get_version())
132133
self.assertEqual(2, cert.get_extension_count())
133134
self.assertEqual(b"subjectAltName", cert.get_extension(0).get_short_name())
134135
self.assertEqual(b"extendedKeyUsage",

0 commit comments

Comments
 (0)