Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help wanted] Don't verify cert #196

Open
smutel opened this issue Feb 11, 2021 · 3 comments
Open

[Help wanted] Don't verify cert #196

smutel opened this issue Feb 11, 2021 · 3 comments

Comments

@smutel
Copy link

smutel commented Feb 11, 2021

Hello,

I am using this piece of code:

defaultScheme := []string{scheme}

t := runtimeclient.New(url, client.DefaultBasePath, defaultScheme)
t.DefaultAuthentication = runtimeclient.APIKeyAuth(authHeaderName, "header",
	fmt.Sprintf(authHeaderFormat, token))
return client.New(t, strfmt.Default), nil

I would like to add an option to not verify SSL cert. What is the easiest way to accomplish this ?

Thanks.

@casualjim
Copy link
Member

construct your client with this: https://github.com/go-openapi/runtime/blob/master/client/runtime.go#L86

@smutel
Copy link
Author

smutel commented Feb 12, 2021

I am not an expert in Go. Could you please tell me how to put the struct TLSClientOptions in my code ?

@fredbi fredbi added the auth label Dec 8, 2023
@fredbi
Copy link
Member

fredbi commented Dec 11, 2023

@smutel
You can create a TLSClient with TLSClientOption, which accepts several options:

  • InsecureSkipVerify: disables server cert check on the client side

Use: client.TLSClient(client.TLSClientOption{InsecureSkipVerify: true})

@fredbi fredbi closed this as completed Dec 11, 2023
@fredbi fredbi reopened this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants