GithubHelp home page GithubHelp logo

Comments (4)

stfnmllr avatar stfnmllr commented on June 23, 2024 1

Please see Driver Doc (DSN) for examples on how to establish a TLS connection:

Examples TLS connection:

"hdb://myuser:mypassword@localhost:39013?TLSRootCAFile=trust.pem"
"hdb://myuser:mypassword@localhost:39013?TLSRootCAFile=trust.pem&TLSServerName=hostname"
"hdb://myuser:mypassword@localhost:39013?TLSInsecureSkipVerify"

from go-hdb.

navossoc avatar navossoc commented on June 23, 2024

The following table lists security properties (property names are case sensitive) that can be used with Go.

It should be:
ENCRYPT=TRUE orENCRYPT=True or ENCRYPT=true

The documentation didn't mention if the value is case sensitive too.

from go-hdb.

pedrualves avatar pedrualves commented on June 23, 2024

Hi @navossoc, thanks for reply.

I also tried this:

hdbDsn     = "hdb://user:password@hostname:port?ENCRYPT=TRUE"

but dont works =/

from go-hdb.

pedrualves avatar pedrualves commented on June 23, 2024

Okay, after a lot of tests I found this palliative solution:

package main

import (
    "crypto/tls"
    "database/sql"
    "github.com/SAP/go-hdb/driver"
    _ "github.com/SAP/go-hdb/driver"
    "log"
)

const (
    HOST     = "host"
    PORT     = ":port"
    USERNAME = "user"
    PASSWORD = "password"
)

func main() {
    c := driver.NewBasicAuthConnector(
        HOST+PORT,
        USERNAME,
        PASSWORD)

    tlsConfig := tls.Config{
        InsecureSkipVerify: false,
        ServerName:         HOST,
    }

    c.SetTLSConfig(&tlsConfig)

    db := sql.OpenDB(c)

    var id int
    var name string
    res := db.QueryRow("SELECT * FROM SCHEMA.TABLE LIMIT 1")

    res.Scan(&id, &name)

    log.Println("res ", id, name)

}

from go-hdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.