Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly generate cert for ZAP API and Callback when accessed with IP address #3959

Closed
denniskniep opened this issue Oct 17, 2017 · 9 comments
Assignees
Milestone

Comments

@denniskniep
Copy link
Member

When I use https within the API or Callback Url I get an error:

Firefox: Secure Connection Failed (SSL_ERROR_INTERNAL_ERROR_ALERT)
Chrome: This site can’t provide a secure connection (ERR_SSL_PROTOCOL_ERROR)

@thc202
Copy link
Member

thc202 commented Oct 17, 2017

With 2.6.0 (or dev/weekly)? While proxying or accessing directly? Java version?

@denniskniep
Copy link
Member Author

Currently working with a dev build. I am accessing the Url without proxying. (If I am proxying there is no problem with the API). I think Callback is never through proxy right?
My Java Version is 1.8

@thc202
Copy link
Member

thc202 commented Oct 17, 2017

Which revision/commit did you use to build? If it's working while proxying it might be a problem with SNI. (Yeah, for the callback it does not need to proxy just wanted to know if it was working for the API.)

No errors in the log when that happens?

@denniskniep
Copy link
Member Author

I tried it with the latest commit 8017bc4

The Log output was:
[ZAP-ProxyThread-34] WARN SSLConnector - No domain extracted from SSL/TLS handshake session.

@thc202
Copy link
Member

thc202 commented Oct 17, 2017

Yeah, that's a problem with SNI. Which version of Firefox are you using? And what's the "update" Java version?

@denniskniep
Copy link
Member Author

Firefox 56
Java 1.8.0_131

@thc202 thc202 added bug and removed bug labels Oct 17, 2017
@denniskniep
Copy link
Member Author

denniskniep commented Oct 17, 2017

The ExtendedSSLSession contains no SNIServerName
I accessed the API and the CallbackEndpoint with an Ip-Address, not with an DNS hostname.

The "Server Name Indication" is defined in the RFC6066.

According to the RFC there are no Ip-Addresses allowed:

Currently, the only server names supported are DNS hostnames;
Literal IPv4 and IPv6 addresses are not permitted in "HostName".

Maybe a workaround is to issue the certificate with all in Zap used Ip-Addresses and HostNames into the SubjectAlternativeName.

@thc202
Copy link
Member

thc202 commented Oct 18, 2017

Right, I assumed you were using the hostname not the IP address.

denniskniep added a commit to denniskniep/zaproxy that referenced this issue Oct 23, 2017
…n the browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
denniskniep added a commit to denniskniep/zaproxy that referenced this issue Oct 23, 2017
…n the browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
denniskniep added a commit to denniskniep/zaproxy that referenced this issue Nov 7, 2017
…e browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
denniskniep added a commit to denniskniep/zaproxy that referenced this issue Nov 7, 2017
…e browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
denniskniep added a commit to denniskniep/zaproxy that referenced this issue May 18, 2018
… in the issued certificate as iPAddress if hostname is an ipv4 or ipv6 Address. Create valid cert for an SSLEndpoint accessed in the browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
denniskniep added a commit to denniskniep/zaproxy that referenced this issue May 18, 2018
… in the issued certificate as iPAddress if hostname is an ipv4 or ipv6 Address. Create valid cert for an SSLEndpoint accessed in the browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
denniskniep added a commit to denniskniep/zaproxy that referenced this issue Nov 1, 2018
… in the issued certificate as iPAddress if hostname is an ipv4 or ipv6 Address. Create valid cert for an SSLEndpoint accessed in the browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
@thc202 thc202 changed the title ZAP API and Callback Extension with Https Properly generate cert for ZAP API and Callback when accessed with IP address Dec 24, 2018
@thc202 thc202 added the bug label Dec 24, 2018
@thc202 thc202 added this to the 2.8.0 milestone Dec 24, 2018
thc202 pushed a commit to denniskniep/zaproxy that referenced this issue Jan 9, 2019
… in the issued certificate as iPAddress if hostname is an ipv4 or ipv6 Address. Create valid cert for an SSLEndpoint accessed in the browser by an IpAddress. Added the IpAddress to the cert as SubjectAlternativeName.
kingthorin added a commit that referenced this issue Jan 9, 2019
…ointsWithIpAddress

Fix for #3959, #4016;. Create valid cert for an SSLEndpoint accessed in the browser by an IpAddress.
@lock
Copy link

lock bot commented Feb 2, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants