zapr-oss / druidry

Java based Druid Query Generator library
Apache License 2.0
193 stars 86 forks source link

Looking for example of using https client with basic authentication. #152

Open scrohde opened 3 years ago

scrohde commented 3 years ago

Hello, I'm new to Java. Could anyone point me to an example usage with https and basic auth? Also, how to modify the hostname verifier?

Thanks!

scrohde commented 3 years ago

Although I can add basic auth credentials to the ClientConfig I never figured out how to add a client certificate or modify the hostname verifier.

I ended up replacing the DruidJerseyClient.java file so that I can have control over those things.

abhi-zapr commented 3 years ago

Hey @scrohde

Sorry for the delayed response, I was on brief hiatus from Druidry.

Yes, as you mentioned basic auth credentials could be provided through ClientConfig. But I think (from what I researched) jersey 2.x onwards they removed support for setting SSLContext and/or HostnameVerifier via properties of ClientConfig and migrated it to static builder factory methods of ClientBuilder. Jersey documentation : jersey.github.io (hyperlink to section was not available, see section 29.24.2.5).

If you have extended DruidJerseyClient with support for SSLContext and/or HostnameVerifier feel free to a raise patch, we'll be happy to look at it and incorporate it.

Thanks.