Re: [go-nuts] sqlserver error "TLS Handshake failed: x509: certificate signed by unknown authority"

2019-09-10 Thread Peggy Scott
Yes!! RUN apt-get update && apt-get install ca-certificates -y

for amd64/ubuntu:18.04

On Tuesday, September 10, 2019 at 12:28:56 PM UTC-7, Marcin Romaszewicz 
wrote:
>
> You're missing the CA Root certificates for whatever linux distribution is 
> running your application. For example, I use Alpine linux as my Docker base 
> image for my Go services, and I must install the certificates like this via 
> the Dockerfile:
>
> RUN apk update && apk add ca-certificates
>
> Find the correct way to do that in your Docker base image.
>
> -- Marcin
>
> On Tue, Sep 10, 2019 at 12:23 PM Peggy Scott  > wrote:
>
>> I am using a dockerized Golang image to connect to my Azure SQL server 
>> database. When I try to ping it, I am running into "TLS Handshake failed: 
>> x509: certificate signed by unknown authority". I am able to run my app 
>> from my box without dockerization without any issues. I am also able to 
>> able to ping my Azure Postgres server with sslmode=require without issues 
>> using the same Golang image. I am using 
>> https://github.com/denisenkom/go-mssqldb package. My connection code is:
>>
>> db, err := sql.Open("sqlserver", "server=
>> myserver.database.windows.net;user id=myuserid;"+
>>  password=mypassword;port=1433;database=mydbname;encrypt=true;
>> TrustServerCertificate=false;"+
>>  connection+timeout=30;hostNameInCertificate=*.database.windows.net;")
>>
>> if err != nil {
>> globals.Log.WithError(err).WithFields(logrus.Fields{
>> "drivername":   "sqlserver",
>> "connectionstring": "secret",
>> "error":err.Error()}).Panic("Unable to connect 
>> to db")
>>
>> What am I missing?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golan...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/0a0591d0-2b5a-4d21-8e95-012ba26b3900%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/0a0591d0-2b5a-4d21-8e95-012ba26b3900%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fbf0462e-e7bd-45f9-8c42-9493cf80df72%40googlegroups.com.


[go-nuts] sqlserver error "TLS Handshake failed: x509: certificate signed by unknown authority"

2019-09-10 Thread Peggy Scott
I am using a dockerized Golang image to connect to my Azure SQL server 
database. When I try to ping it, I am running into "TLS Handshake failed: 
x509: certificate signed by unknown authority". I am able to run my app 
from my box without dockerization without any issues. I am also able to 
able to ping my Azure Postgres server with sslmode=require without issues 
using the same Golang image. I am using 
https://github.com/denisenkom/go-mssqldb package. My connection code is:

db, err := sql.Open("sqlserver", "server=myserver.database.windows.net;user 
id=myuserid;"+
 password=mypassword;port=1433;database=mydbname;encrypt=true;
TrustServerCertificate=false;"+
 connection+timeout=30;hostNameInCertificate=*.database.windows.net;")

if err != nil {
globals.Log.WithError(err).WithFields(logrus.Fields{
"drivername":   "sqlserver",
"connectionstring": "secret",
"error":err.Error()}).Panic("Unable to connect to 
db")

What am I missing?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0a0591d0-2b5a-4d21-8e95-012ba26b3900%40googlegroups.com.