sniproxy | Proxies incoming HTTP and TLS connections | Proxy library
kandi X-RAY | sniproxy Summary
kandi X-RAY | sniproxy Summary
Proxies incoming HTTP and TLS connections based on the hostname contained in the initial request of the TCP session. This enables HTTPS name-based virtual hosting to separate backend servers without installing the private key on the proxy machine.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sniproxy
sniproxy Key Features
sniproxy Examples and Code Snippets
Community Discussions
Trending Discussions on sniproxy
QUESTION
I'm working on a university group project that was previously using MySQL but the team decided to move to MS SQL Server Express. I'm the only team member using a Mac, so I'm trying to get the project to connect to a docker container. I'm working in Visual Studio for Mac.
I've created and started an SQL Express 2017 container with this:
docker run -d --name sqlexpress -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MSSQLContainer1' -e 'MSSQL_PID=Express' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu
Which looks like this when running:
CONTAINER ID: e448f6e4df4
IMAGE: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
COMMAND: "/opt/mssql/bin/sqls…"
CREATED: 21 hours ago
STATUS: Up 21 hours
PORTS: 0.0.0.0:1433->1433/tcp
NAMES: sqlexpress
And when I run SQL Server inside the docker and enter SELECT @@VERSION:
Microsoft SQL Server 2017 (RTM-CU16) (KB4508218) - 14.0.3223.3 (X64) Jul 12 2019 17:43:08 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on Linux (Ubuntu 16.04.6 LTS)
I am able to connect to the to the container from both Azure Data Studio or DBeaver without any issues and create a database called HelpdeskSystem.
But I can't for the life of me get our .NET Core app to connect to the database.
This is my current connection string; though, I've tried different variations:
"Server=localhost\\sqlexpress,1433;Database=HelpdeskSystem;User=sa;Password=MSSQLContainer1;"
Also, this is what the connection string that my teammates are using on their Windows machines looks like (and I've tried including those extra properties in my string as well):
"server=localhost\\sqlexpress;Database=HelpdeskSystem;Trusted_Connection=True;Integrated Security=True;MultipleActiveResultSets=true"
When I attempt to run a unit test that requires database connectivity, I get this exception:
InnerException: {System.Net.Sockets.SocketException (0x80004005): Undefined error: 0 at System.Data.SqlClient.SNI.SSRP.GetPortByInstanceName(String browserHostName, String instanceName) at System.Data.SqlClient.SNI.SNIProxy.CreateTcpHandle(DataSource details, Int64 timerExpire, Object callbackObject, Boolean parallel)}
Message: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 25 - Connection string is not valid)"
I'm not sure if my string is wrong or if there's some other underlying issue preventing the web app from connecting but I'm definitely able to to connect to the container using Azure Data Studio, so I don't see why the web app wouldn't be able to.
...ANSWER
Answered 2019-Oct-01 at 11:02Use this connection string. You can mention tcp infront of loopback ip.
QUESTION
I have a Net.Core Application running with a SQL-Database. The Connection string is in the environment variables.
On Local IIS the Application works fine.
Same Application as Docker-Container got following Error
fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HLPO85V83VNO", Request id "0HLPO85V83VNO:00000001": An unhandled exception was thrown by the application. System.PlatformNotSupportedException: LocalDB is not supported on this platform.
at System.Data.SqlClient.SNI.LocalDB.GetLocalDBConnectionString(String localDbInstance)
at System.Data.SqlClient.SNI.SNIProxy.GetLocalDBDataSource(String fullServerName, Boolean& error)
environment Variables for Docker: "DB_CONNECTION": "Server=hc-XXX; Database=IB33DB-Core_XXX; User Id=sa;Password=XXX"
Here is the setup in the Network
Startup.cs
...ANSWER
Answered 2019-Sep-13 at 15:18The error message means that at some point, your code tries to access the database using a connection string configured for LocalDB. I suspect that in your appsettings.json, there is a connection string that uses LocalDB that is used at some point.
From the code samples I cannot spot the reason for that. Maybe some code bypasses the environment variable and reads the connection string from a configuration file or the container runs an old version of the code.
However, in a project based upon this sample I was able to override the connection string in the container:
The following code uses .NET Core configuration to get the connection string. The advantage of this approach is that you can provide the connection string in several ways and also override it when running the container.
ContextThe context that is used in the sample is a simple one:
QUESTION
I have made a .NET Core 2.2 application from Visual Studio 2017 on my Windows machine and tried to host it on a Linux machine running RHEL 7 Server. I am trying to connect to a SQL Server DB with SqlPassword authentication (I am having a user id and password) using ADO.NET from the application.
I am constantly getting an exception when I am doing this. The issue that I have observed here:
Message: Cannot authenticate using Kerberos. Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered for the SQL Server to allow Kerberos authentication. ErrorCode=InternalError, Exception=Interop+NetSecurityNative+GssApiException: GSSAPI operation failed with error - An invalid status code was supplied (SPNEGO cannot find mechanisms to negotiate). at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext(SafeGssContextHandle& context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte[] buffer, Byte[]& outputBuffer, UInt32& outFlags, Int32& isNtlmUsed) at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& outFlags) at System.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName) at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer) at System.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength), StackTrace: at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource
1 retry) at System.Data.SqlClient.SqlConnection.Open() at MobileMetrics.Services.QueryExecutionDAL.SqlDbToolkit.GetData(IList1 dBQueries, IList
1 columnDetails) in D:__MM_VNext\Middleware\Main\Source\MobileMetrics.Services\DbToolkit\DbToolkits\SqlDbToolkit.cs:line 172
My connection string used is: Data Source=my-server;Initial Catalog=my-db;UserId=testuser;Password=user@123;Trusted_Connection=False;MultipleActiveResultSets=true
Do I have to install any other package? Or is it something related to a proxy? I have searched a lot in the Internet but there is no luck. Please help me in this regard.
The details are as follows: Host: Linux (RHEL 7) .NET Core: v2.2 Database: SQL Server 2012 Developer Edition IDE: Visual Studio 2017 on Windows 7
Thanks in advance... :)
...ANSWER
Answered 2019-Aug-12 at 12:45SQL by default tries windows logins (you knew the world rotated round windows!) even when its an SQL login, despite you saying not trusted, it tries anyway, so on a windows server this often quietly happens in the background, because you already have a kerberos ticket. However, as this is linux, it needs to be told specifically you will not be using any windows based logins, this is done via "Integrated Security=False".
QUESTION
I'm using Linux more specifically Xubuntu. I have installed SQL Server Express on my machine. I'm currently in the making of a web app and my connection does not seem working or I don't understand everything quite right?
The output I get is :
...ANSWER
Answered 2019-Apr-01 at 12:32Try using:
QUESTION
I'm using xamarin forms to develop a cross-platform app. As part of my app, I have a login page where the user enters his credentials and gets authenticated. I'm using entity framework core and I'm connecting to a SQL server which is hosted on Azures cloud. The code works and I can log in successfully, but only with IOS and UWP, if i try with Android I receive this exception:
...ANSWER
Answered 2019-Feb-19 at 23:20I changed the way my app communicates with the database and the problem got solved, instead of communicating from my app directly to the database I'm communicating to it through a web API.
QUESTION
Does UWP support LocalDB?
My investigations indicate there are some issues using localdb that I don't experience with SQL Server 2017 Development edition.
I managed to convert a winforms EF-Code First, xaf application to run as a UWP app with the help of this blog
I have Enterprise Authentication set.
When I run the desktop bridge app it creates the database and log file inside
...ANSWER
Answered 2019-Jan-23 at 20:39I have come to the conclusion that localdb is not a supported version of SQL Server for production.
LocalDB is a special, low impact version of the SQL Server engine, that is not installed as a Windows Service, but launched (made to run) on demand by the ADO.NET client opening a connection to it. It is intended for single user scenarios, and not for any prodcution use - for production you should use SQL Server Express (or higher)
QUESTION
I'm trying to start MusicStore application at Raspberry Pi 3 using Windows IoT system with .NET Core 2.0.4.
I managed to run it on Raspberry using ubuntu, but in Windows, I get an error from screenshot (sorry for not copying it but I didn't get error in putty so I need to use Windows IoT command line and I'm not able to copy this text anywhere).
Both systems were connecting to the database on my PC and linux was able to run application, while Windows is failing, so this is not fault of connection string. I previously had problem with missing sni.dll but as suggested in this thread I repaired it by copying unix.
Any ideas what's wrong?
EDIT: Today i tested it on my old PC (win10-x64) i got same error as on Windows-IoT so i can copy it here.
...ANSWER
Answered 2018-Jun-04 at 07:44As far as i know, Windows IoT Core on arm has not ability to connect to MS SQL Server.You can trace the issue(#9064) on GitHub. You can use additional web service or wcf and communicate over REST-API to work around.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sniproxy
Install required packages sudo apt-get install autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts
Build a Debian package ./autogen.sh && dpkg-buildpackage
Install the resulting package sudo dpkg -i ../sniproxy_<version>_<arch>.deb
Install required packages sudo yum install autoconf automake curl gettext-devel libev-devel pcre-devel perl pkgconfig rpm-build udns-devel
Build a distribution tarball: ./autogen.sh && ./configure && make dist
Build a RPM package rpmbuild --define "_sourcedir `pwd`" -ba redhat/sniproxy.spec
Install resulting RPM sudo yum install ../sniproxy-<version>.<arch>.rpm
install dependencies. brew install libev pcre udns autoconf automake gettext libtool
Read the warning about gettext and force link it so autogen.sh works. We need the GNU gettext for the macro AC_LIB_HAVE_LINKFLAGS which isn’t present in the default OS X package. brew link --force gettext
Make it so ./autogen.sh && ./configure && make
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page