Run Windows 11 using VMWare on base operation system (windows 8.1)
Docker desktop is install on Windows 11 (Virutal machine)
An ASP.NET Web API application with CURD opration with local evironment SQL SERVER database connection in appsetting.json
This configuration works with Visual studio 2019.
When try to create Docker container, local evironment SQL SERVER database connection is not etrablish and do not get result
Try to check from Container CLI, the local enviroment SQL SERVER
ping
netcat
Additional infromation,
when application try to connect local database from docker container, it shows error of
SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.
using docker mssql-tools, we are able to connect local environment database instance
What is the role of the Windows 8.1 host in this configuration? Do you run VSCode there or is it in the virtual machine? I donāt understand where is your client and where is your target SQL server to connect to. Please, explain what you have done and where you have done it exactly. Share commands if it is possible.
Thanks for the additional information, but please, answer the questions what I asked. I need to know exactly where your client is and where your server is. I can guess, because you wrote about Docker installed inside the virtual machine, so the mssql tools as a client is probably inside the virtual machine. However, you havenāt answered where is VSCode and what is the role of the host operating system (Windows 8.1).
Let me tell you what I think and correct me if I am wrong.
You have a Windows 8.1 host operating system just to run a virtual machine (at least in this context)
Everything you do with Docker and MSSQL is inside your virtual machine.
You have Visual Studio Code in the virtual machine.
You use VSCode to develop your application with the help of itās Docker support.
You have an MSSQL server in the virtual machine but not in a container. It is running directly on the Windows 11 VM.
You run the mssql-tools container in which you try to access the MSSQL server on Windows 11 and it works without error message.
You have an application developed by you or just downloaded and configured by you, which also runs inside a container but a different container. This application cannot connect to the database server running on Windows 11. It gives you the SSL error.
Thanks for the reply. please find my answers below.
You have a Windows 8.1 host operating system just to run a virtual machine (at least in this context)
Yes. I have a Windows 8.1 host operating system
Everything you do with Docker and MSSQL is inside your virtual machine.
No. My Visual studio 2019 & Docker are inside VM-Windows 11 & my database is in-network on Windows SERVER 2012 (operating system of the database)
You have Visual Studio Code in the virtual machine.
Yes. I also have Visual studio code, but I am using Visual Studio 2019
You use VSCode to develop your application with the help of itās Docker support.
Yes
You have an MSSQL server in the virtual machine but not in a container. It is running directly on the Windows 11 VM.
No. As I have mentioned that SQL SERVER is in network with different machine
You run the mssql-tools container in which you try to access the MSSQL server on Windows 11 and it works without error message.
Yes, even when I create only mssql-tools container then also my network database is accessed via mssql-tools container.
You have an application developed by you or just downloaded and configured by you, which also runs inside a container but a different container. This application cannot connect to the database server running on Windows 11. It gives you the SSL error.
Application is developed by me. I am using .NET Core API type project and trying to connect the
database via Microsoft.Data.Sqlclient library.
Please, use codeblocks instead of quotes for codes, especially for yaml files in which the indentation is important. I fixed your post.
About the SocketException. It looks like a service cannot listen on a port. But without a more detailed error log, I canāt tell you more. Where did you read this error message? What threw it?
Thanks for the reply. The error is related to port forwarding from the Docker daemon to the VM machine. I have checked the issue on google and found the solution of my issue related to the docker-compose file.