I had one application running in .net core 2.2 and connecting to SQL server 2012. Now I have upgrade my .net core application to 3.1 and also upgraded EF core. After up-gradation this application fail to connect, while running inside docker container. but if I run same application in window machine then it gets connected successfully.
1 Answer
there is issue with security in docker container. this can be resolve by updating openssl.cnf inside docker
I have added following line in docker file
FROM base AS final
WORKDIR /app
RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /usr/lib/ssl/openssl.cnf
3 Comments
David Browne - Microsoft
If this resolved your issue, you should accept this an an answer. See stackoverflow.com/help/self-answer
reggieboyYEAH
This did not work for me github.com/dotnet/SqlClient/issues/222#issuecomment-605559779
Mike Walton
@reggieboyYEAH Maybe you need to set minimum TLS protocol as well? From that same issue thread, check out the comment that has solved the problem for a lot of people: github.com/dotnet/SqlClient/issues/222#issuecomment-535941637