@@ -357,7 +357,7 @@ func LoginOptPlainText(isPlainText bool) LoginOption {
357357 }
358358}
359359
360- func ensureTLSConfig (client * auth.Client , setConfig * tls. Config ) (* tls.Config , error ) {
360+ func ensureTLSConfig (client * auth.Client ) (* tls.Config , error ) {
361361 var transport * http.Transport
362362
363363 switch t := client .Client .Transport .(type ) {
@@ -386,10 +386,7 @@ func ensureTLSConfig(client *auth.Client, setConfig *tls.Config) (*tls.Config, e
386386 return nil , fmt .Errorf ("unable to access TLS client configuration, the provided HTTP Transport is not supported, given: %T" , client .Client .Transport )
387387 }
388388
389- switch {
390- case setConfig != nil :
391- transport .TLSClientConfig = setConfig
392- case transport .TLSClientConfig == nil :
389+ if transport .TLSClientConfig == nil {
393390 transport .TLSClientConfig = & tls.Config {}
394391 }
395392
@@ -399,7 +396,7 @@ func ensureTLSConfig(client *auth.Client, setConfig *tls.Config) (*tls.Config, e
399396// LoginOptInsecure returns a function that sets the insecure setting on login
400397func LoginOptInsecure (insecure bool ) LoginOption {
401398 return func (o * loginOperation ) {
402- tlsConfig , err := ensureTLSConfig (o .client .authorizer , nil )
399+ tlsConfig , err := ensureTLSConfig (o .client .authorizer )
403400
404401 if err != nil {
405402 panic (err )
@@ -415,7 +412,7 @@ func LoginOptTLSClientConfig(certFile, keyFile, caFile string) LoginOption {
415412 if (certFile == "" || keyFile == "" ) && caFile == "" {
416413 return
417414 }
418- tlsConfig , err := ensureTLSConfig (o .client .authorizer , nil )
415+ tlsConfig , err := ensureTLSConfig (o .client .authorizer )
419416 if err != nil {
420417 panic (err )
421418 }
@@ -442,17 +439,6 @@ func LoginOptTLSClientConfig(certFile, keyFile, caFile string) LoginOption {
442439 }
443440}
444441
445- // LoginOptTLSClientConfigFromConfig returns a function that sets the TLS settings on login
446- // receiving the configuration in memory rather than from files.
447- func LoginOptTLSClientConfigFromConfig (conf * tls.Config ) LoginOption {
448- return func (o * loginOperation ) {
449- _ , err := ensureTLSConfig (o .client .authorizer , conf )
450- if err != nil {
451- panic (err )
452- }
453- }
454- }
455-
456442type (
457443 // LogoutOption allows specifying various settings on logout
458444 LogoutOption func (* logoutOperation )
0 commit comments