public class GoogleNetHttpTransport extends 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 GeneralSecurityException, 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(); }
GeneralSecurityException
IOException
Copyright © 2010–2019 Google. All rights reserved.