rlalfo / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

Cannot leverage urlfetch/FetchOptions when using UrlFetchTransport #267

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1.18.0-rc

Per explanation in
https://cloud.google.com/appengine/docs/java/urlfetch/#Java_Secure_connections_a
nd_HTTPS
I am trying to use
https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/ur
lfetch/FetchOptions
to disable validation during dev/test integration scenarios where a remote 
service uses self signed certs.

The google-http-java-client API does not appear to be designed to deal with 
this scenario.

How would you expect it to be fixed?
either expand the HTTPRequest/HTTPRequestFactory API to support an options 
abstraction or provide access to the encapsulated.

My assumption is that to cope with my requirement I have to forgo use of 
google-http-java-client and couple to the AppEngine UrlFetcher API directly.

Original issue reported on code.google.com by objectst...@gmail.com on 3 Nov 2014 at 3:11

GoogleCodeExporter commented 9 years ago
Doesn't UrlFetchTransport.Builder#doNotValidateCertificate() [1] suffice your 
request?

https://code.google.com/p/google-http-java-client/source/browse/google-http-clie
nt-appengine/src/main/java/com/google/api/client/extensions/appengine/http/UrlFe
tchTransport.java#165

Original comment by wonder...@google.com on 30 Dec 2014 at 11:02

GoogleCodeExporter commented 9 years ago
Opps, I must have wiffed seeing the static Builder inner class last month.  I 
guess I never looked deeper than the buildRequest method and then assumed any 
support for certification validation control would be at the request interface.

I can't recall to Nov 3rd but I think I may have been faked out by the JavaDoc

http://javadoc.google-api-java-client.googlecode.com/hg/1.3-alpha/com/google/api
/client/extensions/appengine/http/urlfetch/UrlFetchTransport.html

The JavaDoc does not guide the reader by any account to the certificate 
validation interface.  You may consider as a documentation improvement putting 
a "See Builder inner class methods regarding certification validation control."

thank you

Original comment by objectst...@gmail.com on 31 Dec 2014 at 2:37

GoogleCodeExporter commented 9 years ago
Looks like you were looking at a pretty old version of the Javadoc. The latest 
one is here:

http://javadoc.google-http-java-client.googlecode.com/hg/latest/index.html

Original comment by wonder...@google.com on 31 Dec 2014 at 7:12

GoogleCodeExporter commented 9 years ago
Ugh.  When I search

https://www.google.com/search?q=UrlFetchTransport+JavaDocs

the old JavaDoc pops first. Shrug.

Too bad I didn't seach

https://www.google.com/search?q=UrlFetchTransport+Certificate+Validation

that pointed me right to the Builder.  Hey thanks again, I have it working now.

Original comment by objectst...@gmail.com on 31 Dec 2014 at 11:28