Skip to content

Commit 287d1f7

Browse files
committedOct 26, 2017
[auth] Add test with client cert
1 parent e036fc8 commit 287d1f7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎tests/src/python/test_qgsauthsystem.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,10 @@ def testChain(path):
626626
# Test that a chain with an untrusted CA is not valid
627627
self.assertTrue(len(QgsAuthCertUtils.validateCertChain(QgsAuthCertUtils.certsFromFile(path))) > 0)
628628

629-
# Test that a chain with an untrusted CA is valid when the addRootCa argumentis true
629+
# Test that a chain with an untrusted CA is valid when the addRootCa argument is true
630630
self.assertTrue(len(QgsAuthCertUtils.validateCertChain(QgsAuthCertUtils.certsFromFile(path), None, True)) == 0)
631631

632-
# Test that a chain with an untrusted CA is not valid when the addRootCa argumentis true
632+
# Test that a chain with an untrusted CA is not valid when the addRootCa argument is true
633633
# and a wrong domainis true
634634
self.assertTrue(len(QgsAuthCertUtils.validateCertChain(QgsAuthCertUtils.certsFromFile(path), 'my.wrong.domain', True)) > 0)
635635

@@ -638,18 +638,20 @@ def testChain(path):
638638

639639
path = PKIDATA + '/localhost_ssl_w-chain.pem'
640640

641-
# Test that a chain with an untrusted CA is not valid when the addRootCa argumentis true
641+
# Test that a chain with an untrusted CA is not valid when the addRootCa argument is true
642642
# and a wrong domain is set
643643
self.assertTrue(len(QgsAuthCertUtils.validateCertChain(QgsAuthCertUtils.certsFromFile(path), 'my.wrong.domain', True)) > 0)
644644

645-
# Test that a chain with an untrusted CA is valid when the addRootCa argumentis true
645+
# Test that a chain with an untrusted CA is valid when the addRootCa argument is true
646646
# and a right domain is set
647647
self.assertTrue(len(QgsAuthCertUtils.validateCertChain(QgsAuthCertUtils.certsFromFile(path), 'localhost', True)) == 0)
648648

649649
# Test that a chain with an untrusted CA is not valid when the addRootCa argument is false
650650
# and a right domain is set
651651
self.assertTrue(len(QgsAuthCertUtils.validateCertChain(QgsAuthCertUtils.certsFromFile(path), 'localhost', False)) > 0)
652652

653+
testChain(PKIDATA + '/fra_w-chain.pem')
654+
653655

654656
if __name__ == '__main__':
655657
unittest.main()

0 commit comments

Comments
 (0)
Please sign in to comment.