Kinetic / kinetic-py

Kinetic Python Library
http://seagate.github.io/kinetic-py
22 stars 10 forks source link

SSL timeout with kinetic-py #32

Closed abhideodhar closed 9 years ago

abhideodhar commented 9 years ago

@icorderi -

I am seeing a SSL timeout issue while doing a connect via latest kinetic-python client on SSL port with the Kinetic Java simulator. Is this a client side issue or a server issue?

Thanks Abhijit

Client logs: [root@crane kinetic-py]# python Python 2.7.9 (default, Jul 30 2015, 05:49:38) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from kinetic import * c = Client('209.243.160.69', 8443, use_ssl=True) c.connect() Traceback (most recent call last): File "", line 1, in File "kinetic/greenclient.py", line 53, in connect super(Client, self).connect() File "kinetic/baseclient.py", line 129, in connect self._handshake() File "kinetic/baseclient.py", line 142, in handshake ,cmd,v = self.network_recv() # unsolicited status File "kinetic/baseclient.py", line 330, in network_recv (m, value) = self._recv_delimited_v2() File "kinetic/baseclient.py", line 306, in _recv_delimited_v2 raw_proto = self.fast_read(proto_ln) File "kinetic/baseclient.py", line 283, in fast_read nbytes = self.socket.recv_into(view, toread) File "/usr/local/lib/python2.7/site-packages/eventlet-0.17.4-py2.7.egg/eventlet/green/ssl.py", line 219, in recv_into timeout_exc=timeout_exc('timed out')) File "/usr/local/lib/python2.7/site-packages/eventlet-0.17.4-py2.7.egg/eventlet/hubs/init.py", line 162, in trampoline return hub.switch() File "/usr/local/lib/python2.7/site-packages/eventlet-0.17.4-py2.7.egg/eventlet/hubs/hub.py", line 294, in switch return self.greenlet.switch() ssl.SSLError: ('timed out',)

Server side logs:

Jul 30, 2015 1:05:17 PM com.seagate.kinetic.simulator.io.provider.nio.NioMessageServiceHandler handlerRemoved INFO: connection info is removed, id=1438286686215, is secure channel=true Jul 30, 2015 1:05:20 PM com.seagate.kinetic.common.lib.TlsUtil enableSupportedProtocols INFO: enabled TLS protocol: [TLSv1, TLSv1.1, TLSv1.2] Jul 30, 2015 1:05:20 PM com.seagate.kinetic.simulator.io.provider.nio.NioQueuedRequestProcessRunner INFO: nio queued process runner instantiated. message ordering is enforced. Jul 30, 2015 1:05:20 PM com.seagate.kinetic.simulator.io.provider.nio.ssl.SslChannelInitializer initChannel INFO: ssl nio channel initialized ...

icorderi commented 9 years ago

@abhideodhar the first ssl connection against a Simulator takes slightly longer than it should. I increased the default _connecttimeout to 1 second for the SecureClient to compensate for that.

By the way, if you want to get a secure connection with a drive I recommend you use the new SecureClient class instead of Client.

import kinetic

c = kinetic.SecureClient('209.243.160.69') # default port is 8443
c.connect()
# ...
c.close()
nehajs commented 9 years ago

@icorderi - SecureClient doesn't support Async operations. How can be the async operations be ran with SSL in kinetic-py? Is SecureClient going to support Async operations?

Thanks, Neha