[issue34440] Certificate verify failed (works fine in 3.6)

2018-08-20 Thread Lennart Grahl


New submission from Lennart Grahl :

When running the attached script with the attached cert, Python 3.7 raises an 
exception (see https://paste.pound-python.org/show/VLr84Yn2Fnz6RSKEq3ui/). In 
Python 3.6, the certificate is being accepted.

I don't see anything wrong with the self-signed certificate.

You can (hopefully) reproduce this by running minimal_server.py

--
assignee: christian.heimes
components: SSL
files: minimal_server.zip
messages: 323783
nosy: Lennart Grahl, christian.heimes
priority: normal
severity: normal
status: open
title: Certificate verify failed (works fine in 3.6)
versions: Python 3.7
Added file: https://bugs.python.org/file47754/minimal_server.zip

___
Python tracker 
<https://bugs.python.org/issue34440>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34440] Certificate verify failed (works fine in 3.6)

2018-08-20 Thread Lennart Grahl


Lennart Grahl  added the comment:

Hi.

I don't see why the certificate would not be valid for that address. Python 3.6 
also accepts it without any modifications to the script. 

Output of openssl x509 -in cert.pem -noout -text

Certificate:
Data:
Version: 3 (0x2)
Serial Number:
bc:28:67:9a:b0:fe:d6:b8
Signature Algorithm: ecdsa-with-SHA256
Issuer: CN = 127.0.0.1
Validity
Not Before: Mar 23 16:52:01 2017 GMT
Not After : Mar 21 16:52:01 2027 GMT
Subject: CN = 127.0.0.1
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:9d:e3:f2:f6:e2:8c:f3:25:82:3e:9e:bc:c5:69:
27:34:be:45:89:4a:51:ce:67:4e:b8:a0:b1:a2:bd:
fa:39:f9:38:85:a3:9c:a6:c4:c9:78:24:c7:17:5c:
2b:00:af:7f:73:e2:49:68:9c:37:29:ae:69:bf:b5:
49:06:a8:b8:1d
ASN1 OID: prime256v1
NIST CURVE: P-256
X509v3 extensions:
X509v3 Subject Key Identifier: 
17:66:86:40:B1:C4:BF:77:09:C7:DC:9F:4D:78:4A:BF:07:19:AD:8C
X509v3 Authority Key Identifier: 

keyid:17:66:86:40:B1:C4:BF:77:09:C7:DC:9F:4D:78:4A:BF:07:19:AD:8C

X509v3 Basic Constraints: 
CA:TRUE
Signature Algorithm: ecdsa-with-SHA256
 30:44:02:20:09:d2:c1:85:f9:c5:7f:78:3e:cc:90:78:25:dc:
 9e:76:ef:62:7a:e5:38:0a:a1:6c:c6:27:af:ed:ec:1d:12:06:
 02:20:5d:d0:de:8e:46:ee:e3:67:35:66:fe:11:6e:56:b5:70:
 72:16:33:92:66:0f:6c:da:51:0c:74:d8:c1:b8:8f:b5

--

___
Python tracker 
<https://bugs.python.org/issue34440>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34440] Certificate verify failed (works fine in 3.6)

2018-08-20 Thread Lennart Grahl


Lennart Grahl  added the comment:

Cheers!

--

___
Python tracker 
<https://bugs.python.org/issue34440>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27124] binascii.a2b_hex raises binascii.Error, not TypeError

2016-05-25 Thread Lennart Grahl

New submission from Lennart Grahl:

When using binascii.a2b_hex (or binascii.unhexlify) and the argument is 
invalid, the doc states that it should raise a TypeError for invalid arguments 
(e.g. passing an odd-length string).

However, it does raise binascii.Error instead of TypeError:

try:
binascii.a2b_hex('a')
except Exception as exc:
print(type(exc))

--
assignee: docs@python
components: Documentation
messages: 266368
nosy: Lennart Grahl, docs@python
priority: normal
severity: normal
status: open
title: binascii.a2b_hex raises binascii.Error, not TypeError
type: behavior
versions: Python 3.4

___
Python tracker 
<http://bugs.python.org/issue27124>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27124] binascii.a2b_hex raises binascii.Error and ValueError, not TypeError

2016-05-25 Thread Lennart Grahl

Lennart Grahl added the comment:

When using binascii.a2b_hex (or binascii.unhexlify) and the argument is 
invalid, the doc states that it should raise a TypeError for invalid arguments 
(e.g. passing an odd-length string).

However, it does raise binascii.Error instead of TypeError:

try:
binascii.a2b_hex('a')
except Exception as exc:
print(type(exc))

What surprised me even more was that it raises ValueError (although 
binascii.Error inherits ValueError) in case a unicode string has been passed as 
an argument:

try:
binascii.a2b_hex('รค')
except binascii.Error:
print('binascii.Error')
except ValueError:
print('ValueError')

--
title: binascii.a2b_hex raises binascii.Error, not TypeError -> 
binascii.a2b_hex raises binascii.Error and ValueError, not TypeError

___
Python tracker 
<http://bugs.python.org/issue27124>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com