public class GoogleNetHttpTransport
extends java.lang.Object
NetHttpTransport.| Modifier and Type | Method and Description |
|---|---|
static com.google.api.client.http.javanet.NetHttpTransport |
newTrustedTransport()
Returns a new instance of
NetHttpTransport that uses
GoogleUtils.getCertificateTrustStore() for the trusted certificates using
NetHttpTransport.Builder.trustCertificates(KeyStore)
. |
public static com.google.api.client.http.javanet.NetHttpTransport newTrustedTransport()
throws java.security.GeneralSecurityException,
java.io.IOException
NetHttpTransport that uses
GoogleUtils.getCertificateTrustStore() for the trusted certificates using
NetHttpTransport.Builder.trustCertificates(KeyStore)
.
This helper method doesn't provide for customization of the NetHttpTransport, such as
the ability to specify a proxy. To do use, use
NetHttpTransport.Builder, for example:
static HttpTransport newProxyTransport() throws GeneralSecurityException, IOException {
NetHttpTransport.Builder builder = new NetHttpTransport.Builder();
builder.trustCertificates(GoogleUtils.getCertificateTrustStore());
builder.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 3128)));
return builder.build();
}
java.security.GeneralSecurityExceptionjava.io.IOExceptionCopyright © 2010-2018 Google. All Rights Reserved.