Skip to content

default client: use custom HostnameVerifier if overridden - #54

Merged
codefromthecrypt merged 1 commit into
OpenFeign:masterfrom
davidmc24:custom-hostnameverifier
Aug 28, 2013
Merged

codefromthecrypt merged 1 commit into
OpenFeign:masterfrom
davidmc24:custom-hostnameverifier

Conversation

@davidmc24

Copy link
Copy Markdown
Contributor

Sometimes, it's useful to override the hostname verifier for SSL connections... for example, when you're developing against a test server managed by another company that's using a self-signed certificate with a mis-matched hostname. This patch enables that usage by overriding the default HostnameVerifier in a Dagger module.

I haven't included any tests in the initial submission. In order to test this behavior, we'd need to perform actual certificate negotiation, which TrustingSSLSocketFactory currently avoids. If test coverage for this is desired, I'm willing to contribute it, but didn't want to spend the time on it unless the enhancements to TrustingSSLSocketFactory were desired.

@cloudbees-pull-request-builder

Copy link
Copy Markdown

feign-pull-requests #65 SUCCESS
This pull request looks good

@codefromthecrypt

Copy link
Copy Markdown

+1 go ahead and put in a straight-forward test. I agree this needs to be here.

@davidmc24

Copy link
Copy Markdown
Contributor Author

Sure. I'll see what needs to be done to make this testable.

@davidmc24

Copy link
Copy Markdown
Contributor Author

Test added.

@cloudbees-pull-request-builder

Copy link
Copy Markdown

feign-pull-requests #66 SUCCESS
This pull request looks good

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while it is true that you guys own the copyright, our license header script will clobber this. As copyright statements in headers are really only advisory, do you mind changing this to Netflix? If it is important to track this specifically, you can add a NOTICE.txt and cite this file and Commerce Tech there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding of the gradle license plugin is that the skipExistingHeaders configuration setting (as this project has set in /gradle/license.gradle) is intended to allow files that already have headers to not be clobbered. Regardless, I'm fine with changing it if desired.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally I don't care :) just would prefer to code vs ask about license header exception

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me. I'll make the change and squash.

@codefromthecrypt

Copy link
Copy Markdown

one license header nit, then if you don't mind squashing the commits.

good job.

Sometimes, it's useful to override the hostname verifier for SSL connections.
One example, would be when you're developing against a test server managed by
another company that's using a self-signed certificate with a mis-matched
hostname. This patch enables that usage by overriding the default
HostnameVerifier in a Dagger module.

Adding test coverage required switching the TrustingSSLSocketFactory from
using an anonymous cipher suite to one that authenticates.  A test keystore is
used for this purpose.  It contains two self-signed certificates, one
each with alias (and CN) "localhost" and "bad.example.com".  The
TrustingSSLSocketFactory is no longer a singleton; it now
optionally takes a key alias as an argument.
@davidmc24

Copy link
Copy Markdown
Contributor Author

License changed to use netflix standard, NOTICE file added, all commits squashed.

@cloudbees-pull-request-builder

Copy link
Copy Markdown

feign-pull-requests #67 SUCCESS
This pull request looks good

codefromthecrypt pushed a commit that referenced this pull request Aug 28, 2013
default client: use custom HostnameVerifier if overridden
@codefromthecrypt
codefromthecrypt merged commit b5b4593 into OpenFeign:master Aug 28, 2013
@codefromthecrypt

Copy link
Copy Markdown

cherry-picked into 4.x

note I forgot to ask you to put in a blurb in CHANGES.md. Can you piggyback that onto your next PR?

thanks!

@davidmc24

Copy link
Copy Markdown
Contributor Author

Sure thing. Based on your cherry picking into the 4.x branch, is 4.4 likely the next release? Is master the preferred branch for pull requests?

@davidmc24
davidmc24 deleted the custom-hostnameverifier branch August 28, 2013 23:35
@codefromthecrypt

Copy link
Copy Markdown

Master is still best until we refactor on the "simplify" issue

On Wednesday, August 28, 2013, David M. Carr wrote:

Sure thing. Based on your cherry picking into the 4.x branch, is 4.4
likely the next release? Is master the preferred branch for pull requests?

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/54#issuecomment-23457100
.

velo pushed a commit to velo/feign that referenced this pull request Apr 20, 2019
Add OpenFeign 10 support and update test accordingly
velo pushed a commit that referenced this pull request Oct 7, 2024
Add OpenFeign 10 support and update test accordingly
velo pushed a commit that referenced this pull request Oct 8, 2024
default client: use custom HostnameVerifier if overridden
velo pushed a commit that referenced this pull request Oct 8, 2024
Add OpenFeign 10 support and update test accordingly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants