[issue15464] ssl: add set_msg_callback function

2017-09-06 Thread Christian Heimes

Christian Heimes added the comment:

I talked with other ssl module maintainers. We agreed that the debug callback 
is out of scope for Python stdlib. The ssl does not try to be an 
all-encompassing wrapper of OpenSSL.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2017-09-06 Thread Christian Heimes

Christian Heimes added the comment:

I'm reluctant to add new features to the ssl module unless they increase 
security. The message callback is a debugging hook to analyse handshake and 
other low level parts of the protocol.

--
assignee: christian.heimes -> 
components:  -Extension Modules

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2016-09-15 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes
components: +SSL
versions:  -Python 3.6

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2016-09-08 Thread Christian Heimes

Changes by Christian Heimes :


--
versions: +Python 3.6, Python 3.7 -Python 3.5

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2016-06-12 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2013-11-17 Thread Christian Heimes

Christian Heimes added the comment:

The patch won't be ready for 3.4 beta1 next weekend. Deferring to 3.5

--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2013-08-14 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2013-06-14 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-10-04 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-08-06 Thread Thiébaud Weksteen

Thiébaud Weksteen added the comment:

When I wrote this patch, I was focusing on a particular usage and the buffer 
was the only parameter that interested me. But you're right, the other 
parameters should be included. Which brings the following questions:

* write_p looks like a boolean, would it be appropriate to make it like that? 
Or keep it integer?
* version can be SSL2_VERSION , SSL3_VERSION or TLS1_VERSION. However, these 
constants are not used yet in _ssl. Should they be mapped to the current ones 
(with the tricky exception of PROTOCOL_SSLv23)?
* content_type could just be passed as a regular integer.

Thanks

--

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-08-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thiébaud, I haven't reviewed the patch in detail, but why does the callback 
only receive the buffer contents? At the minimum, I think it should also 
receive write_p (whether the packet is an incoming or outgoing message is a 
rather useful piece of information).

--
stage:  -> patch review

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-07-30 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I haven't commented on the content of your patch (I'm not knowledgeable enough 
in this area), but as for your test, I noticed that you removed the part that 
asserted something about the argument passed to cb().

Ideally when testing a callback, you want to test whatever is important about 
it, like: that it gets called at the right times (and as many times as it 
should), and that it is getting passed the right data.

So you might also want to make whatever assertions are appropriate about the 
packet(s) passed to cb().

--

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-07-29 Thread Thiébaud Weksteen

Thiébaud Weksteen added the comment:

I've updated the patch with this method of testing.

--
Added file: http://bugs.python.org/file26589/ssl_msg_callback-0.2.patch

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-07-27 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

That is one way to do it.  But it would be better to use a local variable 
rather than an attribute of the class (because otherwise you have to worry 
about resetting the value if more than one test uses the same pattern).  
Something like this would be better

called = []
def cb(packet):
called.append(1)

--

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-07-26 Thread Thiébaud Weksteen

Thiébaud Weksteen  added the comment:

I'm not sure what would be the best way to verify that. 
What about:

def test_connect_with_msg_callback(self):
with support.transient_internet("svn.python.org"):
self.called = False
def cb(packet):
self.assertGreater(len(packet), 0)
self.called = True
ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
ctx.set_msg_callback(cb)
s = ctx.wrap_socket(socket.socket(socket.AF_INET))
try:
s.connect(("svn.python.org", 443))
self.assertTrue(self.called)
finally:
s.close()

--

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek  added the comment:

In your test, is there a reason you don't need to verify that your callback is 
actually called?

+def cb(packet):
+  self.assertGreater(len(packet), 0)
+ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ctx.set_msg_callback(cb)

--
nosy: +cjerdonek

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-07-26 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +pitrou

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-07-26 Thread Thiébaud Weksteen

New submission from Thiébaud Weksteen :

I wrote a patch for Python 3 to expose the function
SSL_CTX_set_msg_callback in the module ssl.

Here is a description of this function:
"SSL_CTX_set_msg_callback() or SSL_set_msg_callback() can be used
to define a message callback function cb for observing all SSL/TLS
protocol messages (such as handshake messages) that are received or sent."

There is also a test case included in the patch.

Comments are welcomed.

--
components: Extension Modules
files: ssl_msg_callback.patch
keywords: patch
messages: 166532
nosy: tweksteen
priority: normal
severity: normal
status: open
title: ssl: add set_msg_callback function
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file26534/ssl_msg_callback.patch

___
Python tracker 

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