Hi All,
BackGround:
I used to connect to database with Encrypt set true in sql connection which helps established encrypted data base connection . I verified that created certificate in order
to provide Encrypted connection to database for client is valid.
Issue :Issue
is un-able to connect to sql sever2008 r2 from vs2013 by enforcing encryption to true.
while trying to test the connection from vs2013 error log getting recorded as well as error notification is getting populated as below .
Step1 :
from Vs2013 trying to connect to sql server 2008 r2
step 2: on Click test Connection . getting below mentioned error notification
Event Viewer Log:<o:p></o:p>
<o:p></o:p>
(Process Id: 7472) <o:p></o:p>
.Net SqlClient Data Provider:<o:p></o:p>
A connection was successfully established with the server, but then an error
occurred during the login process. (provider: SSL Provider, error: 0 - The
target principal name is incorrect.)<o:p></o:p>
at
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,
Boolean breakConnection, Action`1 wrapCloseInAction)<o:p></o:p>
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)<o:p></o:p>
at
System.Data.SqlClient.TdsParserStateObject.SNIWritePacket(SNIHandle handle,
SNIPacket packet, UInt32& sniError, Boolean canAccumulate, Boolean
callerHasConnectionLock)<o:p></o:p>
at System.Data.SqlClient.TdsParserStateObject.WriteSni(Boolean
canAccumulate)<o:p></o:p>
at System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte
flushMode, Boolean canAccumulate)<o:p></o:p>
at System.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec,
FeatureExtension requestedFeatures, SessionData recoverySessionData)<o:p></o:p>
at
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
serverInfo, String newPassword, SecureString newSecurePassword, Boolean
ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)<o:p></o:p>
at
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo
serverInfo, String newPassword, SecureString newSecurePassword, Boolean
redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential
credential, TimeoutTimer timeout)<o:p></o:p>
at
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer
timeout, SqlConnectionString connectionOptions, SqlCredential credential,
String newPassword, SecureString newSecurePassword, Boolean
redirectedUserInstance)<o:p></o:p>
at
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, SqlCredential credential,
Object providerInfo, String newPassword, SecureString newSecurePassword,
Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions,
SessionData reconnectSessionData)<o:p></o:p>
at
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions
userOptions)<o:p></o:p>
at
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool
pool, DbConnection owningObject, DbConnectionOptions options,
DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)<o:p></o:p>
at
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject, DbConnectionOptions userOptions, DbConnectionInternal
oldConnection)<o:p></o:p>
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject, DbConnectionOptions userOptions, DbConnectionInternal
oldConnection)<o:p></o:p>
at
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate,
Boolean onlyOneCheckConnection, DbConnectionOptions userOptions,
DbConnectionInternal& connection)<o:p></o:p>
at
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions,
DbConnectionInternal& connection)<o:p></o:p>
at
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection
owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions
userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&
connection)<o:p></o:p>
at
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection
outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1
retry, DbConnectionOptions userOptions)<o:p></o:p>
at
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)<o:p></o:p>
at
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)<o:p></o:p>
at System.Data.SqlClient.SqlConnection.Open()<o:p></o:p>
Inner Exception:<o:p></o:p>
:<o:p></o:p>
The target principal name is incorrect