getattr now works when no socket is wrapped
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index 2317404..6b0b944 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -1146,7 +1146,10 @@
Look up attributes on the wrapped socket object if they are not found on
the Connection object.
"""
- return getattr(self._socket, name)
+ if self._socket is None:
+ raise AttributeError("'" + self.__class__.__name__ + "' object has no attribute '" + name + "'")
+ else:
+ return getattr(self._socket, name)
def _raise_ssl_error(self, ssl, result):