34 check(_verifycert(cert('*.foo'), 'foo'), |
30 check(_verifycert(cert('*.foo'), 'foo'), |
35 'certificate is for *.foo') |
31 'certificate is for *.foo') |
36 check(_verifycert(cert('*o'), 'foo'), |
32 check(_verifycert(cert('*o'), 'foo'), |
37 'certificate is for *o') |
33 'certificate is for *o') |
38 |
34 |
39 import time |
35 check(_verifycert({'subject': ()}, |
40 lastyear = time.gmtime().tm_year - 1 |
|
41 nextyear = time.gmtime().tm_year + 1 |
|
42 check(_verifycert({'notAfter': 'May 9 00:00:00 %s GMT' % lastyear}, |
|
43 'example.com'), |
|
44 'certificate expired May 9 00:00:00 %s GMT' % lastyear) |
|
45 check(_verifycert({'notBefore': 'May 9 00:00:00 %s GMT' % nextyear}, |
|
46 'example.com'), |
|
47 'certificate not valid before May 9 00:00:00 %s GMT' % nextyear) |
|
48 check(_verifycert({'notAfter': 'Sep 29 15:29:48 %s GMT' % nextyear, |
|
49 'subject': ()}, |
|
50 'example.com'), |
36 'example.com'), |
51 'no commonName found in certificate') |
37 'no commonName found in certificate') |
52 check(_verifycert(None, 'example.com'), |
38 check(_verifycert(None, 'example.com'), |
53 'no certificate received') |
39 'no certificate received') |