-
Notifications
You must be signed in to change notification settings - Fork 67
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
x509: certificate signed by unknown authority #582
Comments
hi @fmtovland - it's possible to add the cert to your chain, this is tedious, though. It would be possible for us to modify the CLI to pass an http client on each method it seems like, with an http client that has tls verify disabled - I don't think we'd want this to be a default and we could possibly provide a flag / context field for this. this modification requires some finagling of the provider/fn_go setup that the cli uses, happy to help with pointers/PRs, I am not sure I'll get to this myself in the next couple of weeks (it's a bit painful to maneuver) |
it seems like we can do something like: // configure somewhere in config step in cli w/ env vars
var httpClient = &http.Client{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
client.CurrentProvider().APIClientv2().Transport.Client = httpClient |
You can add the server cert to the RootCAs if you don't want this to be insecure:
|
I get always errors with trying examples/basic since Go on Windows does not support root certification. On Windows, you should set cfg.CertPath to diff --git a/examples/common.go b/examples/common.go
index 81a4b8a..6164a37 100644
--- a/examples/common.go
+++ b/examples/common.go
@@ -105,6 +105,9 @@ import (
"flag"
"fmt"
"os"
+ "path/filepath"
+ "runtime"
+ "strings"
"github.com/oracle/nosql-go-sdk/nosqldb"
"github.com/oracle/nosql-go-sdk/nosqldb/auth/cloudsim"
@@ -245,6 +248,18 @@ func CreateClient() (client *nosqldb.Client, err error) {
} else {
cfg.Region = region
}
+
+ if runtime.GOOS == "windows" {
+ fn := args.configFile
+ if strings.HasPrefix(fn, "~") {
+ home, err := os.UserHomeDir()
+ if err == nil {
+ fn = filepath.Join(home, fn[1:])
+ }
+ }
+ cfg.InsecureSkipVerify = true
+ cfg.CertPath = filepath.ToSlash(filepath.Join(filepath.Dir(fn), "oci_api_key.pem"))
+ }
} else {
cfg.Endpoint = args.endpoint
} I know you already have sdkutil.ExpandPath and way to handle KeyFilePath. But current implementation does not have a way to get KeyFilePath from configurationProvider. |
BTW, I found some bugs that using |
So I put my fn server instance behind a reverse proxy with a self signed ssl certificate. Is there any way I could just tell the fn cli to trust my certificate? At present I keep getting the error "x509: certificate signed by unknown authority"
The text was updated successfully, but these errors were encountered: