interactive icon indicating copy to clipboard operation
interactive copied to clipboard

TrustServerCertificate=true

Open CJP143 opened this issue 7 months ago • 0 comments

Describe the bug

I run #r "nuget: Microsoft.DotNet.Interactive.SqlServer, -" and it installs • Microsoft.DotNet.lnteractive.SqlServer,1.UO-beta25160.1 fine and I used to use #!connect mssql --kernel-name sqlconn --connection-string "Server=mydb; Database=mytbl;Trusted_connection=true" but now get Error: System.Exception: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) which is fine as https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/certificate-chain-not-trusted?tabs=ole-db-driver-19 says to use ;TrustServerCertificate=true which again is fine but nothing happens the kernel just runs until I have to restart and I get no error messages.

part of log looks like the call fails for some reason but I get no message. 2025-03-26T09:44:38.1335309Z [00-26f13f87b68e3791897d36ff17ac5c20-d0149f4559aa06f0-00] ℹ ➡️ ConnectMsSqlKernel kernel://pid-18948/ 2025-03-26T09:44:38.1335897Z [00-26f13f87b68e3791897d36ff17ac5c20-d0149f4559aa06f0-00] ℹ ⁞Ε⁞ CommandFailed Command failed: SubmitCode: #!connect mssql --kern ... (Command: SubmitCode, Token: LK8FxlFnRHyWi6yG5HtmeA==) 2025-03-26T09:44:38.1336142Z [00-26f13f87b68e3791897d36ff17ac5c20-d0149f4559aa06f0-00] ℹ ⬅️ CommandFailed kernel://pid-18948/csharp 2025-03-26T09:44:38.1337510Z [00-26f13f87b68e3791897d36ff17ac5c20-c905afc987ed6f71-00] ℹ ⁞Ε⁞ CommandFailed Command failed: SubmitCode: #!connect mssql --kern ... (Command: SubmitCode, Token: LK8FxlFnRHyWi6yG5HtmeA==) 2025-03-26T09:44:38.1337553Z [00-26f13f87b68e3791897d36ff17ac5c20-d0149f4559aa06f0-00] [KernelScheduler] [Run] ⏹ -> ✔ (2723.8331ms)

tried to use DOTNET_SQLTOOLSSERVICE_LOGFILE to see what messages returned but that failed with RPC error

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):

Image

  • OS
    • [ ] Windows 11
    • [X ] Windows 10
    • [ ] macOS
    • [ ] Linux (Please specify distro)
    • [ ] iOS
    • [ ] Android
  • Browser
    • [ ] Chrome
    • [ ] Edge
    • [ ] Firefox
    • [ ] Safari
  • Frontend
    • [ ] Jupyter Notebook
    • [ ] Jupyter Lab
    • [ ] nteract
    • [ X] Visual Studio Code
    • [ ] Visual Studio Code Insiders
    • [ ] Visual Studio
    • [ ] Other (please specify)

Screenshots

If applicable, add screenshots to help explain your problem.

CJP143 avatar Mar 26 '25 09:03 CJP143