MarketSquare / robotframework-requests

Robot Framework keyword library wrapper for requests
http://marketsquare.github.io/robotframework-requests/
MIT License
490 stars 281 forks source link

Can't set SSL verification to value ssl.CERT_NONE #379

Open tkilpela opened 1 year ago

tkilpela commented 1 year ago

It seems that it's not possible to either set verify=ssl.CERT_NONE or IntEnum value 0 for requests.

${response}= request.HEAD ${url} verify=0

Test                                             | FAIL |
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: 0

${response}= request.HEAD ${url} verify=ssl.CERT_NONE

Test                                             | FAIL |
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: ssl.CERT_NONE

It would be good to have support for this, as verify=False is still trying to read some SSL response from server end. There are cases where the server we are sending https requests to has something misconfigured and this is leading to a SSLError.

An example SSLError with verify=False Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)'))

This can be bypassed by setting a value of ssl.CERT_NONE to verify argument in python (https://docs.python.org/3/library/ssl.html#ssl.CERT_NONE), so it would be great to have support for this also in robotframework-requests.

phinds1 commented 9 months ago

I think this might be the same issue. PR here

https://github.com/MarketSquare/robotframework-requests/pull/387

PaulBrandUWV commented 6 months ago

From the requests documentation it seems it's not possible to pass "ssl.CERT_NONE" to the verify argument of the request method: https://docs.python-requests.org/en/latest/api/#requests.request It accepts only bool or string (path to cert).

Can you provide an (python) example that shows the difference between passing False and ssl.CERT_NONE?

Your should be able to pass ${ssl.CERT_NONE} instead of ssl.CERT_NONE in Robot framework