Hi ! I'm trying to authenticate to a remote sql server using azure AD authentication without any success.
I am stuck with a a cryptic error : TLS Handshake failed: unexpected packet 4, expecting prelogin
sqlcmd -S XXXX.crm4.dynamics.com -d mydb -G -U USER@YYYY.onmicrosoft.com -P PASSWORD is working just fine.
I wanted to test access to the DB using an access token but never got a chance to do it as the code fails in tds.go, line 1117 :
err = tlsConn.Handshake()
So, it never reaches line 1137 : login, err := prepareLogin(ctx, c, p, log, auth, fedAuth, uint32(outbuf.PackageSize())) to prepare login based on the access token.
I must be missing something but I don't know what.
The only difference from what I've read so far is that I'm trying to connect to an SQL server instance running for Dynamics 365.
Any help would be appreciated (@wrosenuance, @paulmey ?) !
Hi ! I'm trying to authenticate to a remote sql server using azure AD authentication without any success. I am stuck with a a cryptic error :
TLS Handshake failed: unexpected packet 4, expecting prelogin
Here is the simple program i used :
Code is using master branch, not v0.9.0 tag and therefore contains https://github.com/denisenkom/go-mssqldb/pull/546
sqlcmd -S XXXX.crm4.dynamics.com -d mydb -G -U USER@YYYY.onmicrosoft.com -P PASSWORD
is working just fine.I wanted to test access to the DB using an access token but never got a chance to do it as the code fails in
tds.go
, line 1117 :err = tlsConn.Handshake()
So, it never reaches line 1137 :login, err := prepareLogin(ctx, c, p, log, auth, fedAuth, uint32(outbuf.PackageSize()))
to prepare login based on the access token.I must be missing something but I don't know what. The only difference from what I've read so far is that I'm trying to connect to an SQL server instance running for Dynamics 365. Any help would be appreciated (@wrosenuance, @paulmey ?) !