Closed b4handjr closed 4 years ago
So you want to verify the base URL but skip checking the certificate is valid? We could maybe add a --verify-base-url-cert
option with associated environment variable to control this.
--verify-base-url-cert
would require a Certificate, and --verify-base-url
wouldn't?
Maybe an --ignore-cert
or --verify-cert
instead? @davehunt
I see how my suggestion is ambiguous, and I didn't really think it through. How about --accept-insecure-base-url
?
Question: What are we really checking with --verify-base-url
if not that it has a valid cert? 🤔
Isn't the solution here to just skip the flag? 🤷♂
Question: What are we really checking with
--verify-base-url
if not that it has a valid cert? 🤔Isn't the solution here to just skip the flag? 🤷♂
We're verifying that it's a valid URL (returns a valid status code). It also (currently) verifies the cert. See https://github.com/pytest-dev/pytest-base-url#verifying-the-base-url
Question: What are we really checking with
--verify-base-url
if not that it has a valid cert? 🤔 Isn't the solution here to just skip the flag? 🤷♂We're verifying that it's a valid URL (returns a valid status code). It also (currently) verifies the cert. See https://github.com/pytest-dev/pytest-base-url#verifying-the-base-url
Right, but let's say we don't and the URL isn't valid (regardless of cert) wouldn't the error from the driver tell us that? I'm trying to see the value in a use-case where we only basically "ping" the URL without validating the cert. 🤔
I guess in theory if you're not using webdriver/selenium and doing some API testing, it has some value, but again I would expect whatever library is used for the requests to give an error about URL being unreachable or such. 🤔
Question: What are we really checking with
--verify-base-url
if not that it has a valid cert? 🤔 Isn't the solution here to just skip the flag? 🤷♂We're verifying that it's a valid URL (returns a valid status code). It also (currently) verifies the cert. See https://github.com/pytest-dev/pytest-base-url#verifying-the-base-url
Right, but let's say we don't and the URL isn't valid (regardless of cert) wouldn't the error from the driver tell us that? I'm trying to see the value in a use-case where we only basically "ping" the URL without validating the cert. 🤔
Yes, but every single test will fail with the same reason. The value of this check is that it aborts the entire test session if the URL is invalid. When using Selenium, you can also accept insecure certificates.
I guess in theory if you're not using webdriver/selenium and doing some API testing, it has some value, but again I would expect whatever library is used for the requests to give an error about URL being unreachable or such. 🤔
Yes, but every single test will fail with the same reason. The value of this check is that it aborts the entire test session if the URL is invalid.
Ah, gotcha! Thanks! 👍
I can work on a patch for this
@jrbenny35 Any updates on this? :)
@jrbenny35 Any updates on this? :)
I have been a bit busy with work but I will try to get something sooner than later.
How about instead of another flag, just give the one we have a value?
--verify-base-url=ignore-cert
@jrbenny35 Is this still a problem in need of a fix?
I know urllib3
has done a couple of new releases surrounding TLS/SSL.
How about instead of another flag, just give the one we have a value?
--verify-base-url=ignore-cert
@jrbenny35 Is this still a problem in need of a fix?
I know
urllib3
has done a couple of new releases surrounding TLS/SSL.
ping @davehunt
I'll let @jrbenny35 respond. I'm not aware of any other experiencing this issue.
I haven't ran into this issue but let me try and see if I can reproduce it again.
Hey @jrbenny35,
Any luck repro:ing? :)
Hey! I have not had any luck. I guess lets close this and if I run into it again I will open it with another log. Thanks for your patience!
When I try to use
--verify-base-url
against a host that has a self signed certificate, verify times out with this error:According to this there is a way for requests to skip this verification. Of course that can lead to other problems.