You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/01/21 01:54:42 UTC

[GitHub] mdeuser commented on a change in pull request #112: Load X509 cert on client creation

mdeuser commented on a change in pull request #112: Load X509 cert on client creation
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/112#discussion_r249308658
 
 

 ##########
 File path: whisk/client.go
 ##########
 @@ -214,19 +231,26 @@ func (c *Client) LoadX509KeyPair() error {
 		}
 	}
 
-	// Use the defaultTransport as the transport basis to maintain proxy support
-	c.client.Transport = &http.Transport{
-		Proxy: http.ProxyFromEnvironment,
-		DialContext: (&net.Dialer{
-			Timeout:   30 * time.Second,
-			KeepAlive: 30 * time.Second,
-			DualStack: true,
-		}).DialContext,
-		MaxIdleConns:          100,
-		IdleConnTimeout:       90 * time.Second,
-		TLSHandshakeTimeout:   10 * time.Second,
-		ExpectContinueTimeout: 1 * time.Second,
-		TLSClientConfig:       tlsConfig,
+	// only set new transport when the TLS config is nondefault
+	if tlsModified {
 
 Review comment:
   maybe no need to introduce a new var (tlsModified) that's set in two places.. instead just
   ```
   // Only replace the existing transport when a custom TLS configuration is needed
   if c.Config.Insecure || tlsConfig.Certificates != nil {
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services