Skip to content

Commit

Permalink
Fixed AttributeError when calling get_app_data()
Browse files Browse the repository at this point in the history
  • Loading branch information
chakatodd authored and toddchapman committed Jan 18, 2016
1 parent b3316fc commit 4f73e4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,7 @@ def __init__(self, context, socket=None):
ssl = _lib.SSL_new(context._context)
self._ssl = _ffi.gc(ssl, _lib.SSL_free)
self._context = context
self._app_data = None

# References to strings used for Next Protocol Negotiation. OpenSSL's
# header files suggest that these might get copied at some point, but
Expand Down
3 changes: 2 additions & 1 deletion tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2401,9 +2401,10 @@ def test_app_data(self):
:py:obj:`Connection.get_app_data`.
"""
conn = Connection(Context(TLSv1_METHOD), None)
assert None is conn.get_app_data()
app_data = object()
conn.set_app_data(app_data)
self.assertIdentical(conn.get_app_data(), app_data)
assert conn.get_app_data() is app_data

def test_makefile(self):
"""
Expand Down

0 comments on commit 4f73e4f

Please sign in to comment.