Skip to content

Instantly share code, notes, and snippets.

View saurabh500's full-sized avatar
Working !

Saurabh Singh saurabh500

Working !
  • Microsoft Corp
View GitHub Profile
Found on OS Ubuntu
DNX 1.0.0-rc1-16108 coreclr x64 linux
System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Interop+OpenSsl+SslException: Operation failed with error - 12.
--- End of inner exception stack trace ---
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Data.SqlClient.Tests.Program.Main(String[] args)
@saurabh500
saurabh500 / EF Test Results
Created November 6, 2015 03:31
Entity Framework Test logs
xUnit.net DNX Runner (64-bit DNXCore 5.0)
Discovering: EntityFramework.MicrosoftSqlServer.FunctionalTests
Discovered: EntityFramework.MicrosoftSqlServer.FunctionalTests
Starting: EntityFramework.MicrosoftSqlServer.FunctionalTests
Microsoft.Data.Entity.SqlServer.FunctionalTests.SqlServerValueGenerationScenariosTest+NonKeyReadOnlyDefaultValueThrows.Insert_explicit_value_throws_when_readonly_before_save
Microsoft.Data.Entity.SqlServer.FunctionalTests.SqlServerValueGenerationScenariosTest+ServerGuidKey.Insert_with_server_generated_GUID_key
Microsoft.Data.Entity.SqlServer.FunctionalTests.SqlServerConfigPatternsTest+InjectConfiguration.Can_register_configuration_with_DI_container_and_have_it_injected
Microsoft.Data.Entity.SqlServer.FunctionalTests.SqlServerValueGenerationScenariosTest+NoKeyGenerationNullableKey.Insert_with_explicit_with_default_keys
Microsoft.Data.Entity.SqlServer.FunctionalTests.SqlServerValueGenerationScenariosTest+IdentityColumnWithDefaultValue.Insert_with_default_v
xUnit.net DNX Runner (64-bit DNXCore 5.0)
Discovering: EntityFramework.MicrosoftSqlServer.FunctionalTests
Discovered: EntityFramework.MicrosoftSqlServer.FunctionalTests
Starting: EntityFramework.MicrosoftSqlServer.FunctionalTests
Microsoft.Data.Entity.SqlServer.FunctionalTests.SqlServerValueGenerationScenariosTest+DoNothingButSpecifyKeys.Insert_with_explicit_non_default_keys
Microsoft.Data.Entity.SqlServer.FunctionalTests.NullKeysSqlServerTest.Include_with_null_FKs_and_nullable_PK
System.Data.SqlClient.SqlException : The connection is broken and recovery is not possible. The connection is marked by the server as unrecoverable. No attempt was made to restore the connection.
Stack Trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlConnection.ValidateAndReconnect(Action beforeDisconnect, Int32 timeout)
@saurabh500
saurabh500 / SchemaProposal.md
Last active February 4, 2016 23:03
GetColumnSchema API

API for GetColumnSchema

Problem

DbDataReader on .Net Framework, provides an API called DataTable GetSchemaTable() which was returns the metadata of the columns being read using the DbDataReader object. Because of the removal of DataTable in .Net Core this API had to be removed. DbDataReader.GetSchemaTable() needs a replacement in .Net core.

Progress

The data structure DbColumn along with the necessary attributes which should be present

import java.sql.Connection;
import java.sql.Statement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.DriverManager;
public class CRUD {
public static void main(String[] args) {
@saurabh500
saurabh500 / LocalDB.Windows.cs
Created March 24, 2017 02:52
LocalDB implementation with LazyInitialization
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
T:System.Data.SqlClient.OnChangeEventHandler
T:System.Data.SqlClient.PoolBlockingPeriod
  This was a new feature added to Azure Sql. Needs a port to Sql Client on .Net Core
T:System.Data.SqlClient.SqlAuthenticationMethod
  Needed for Federated Authentication. https://github.com/dotnet/corefx/issues/8807
M:System.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear
M:System.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt(System.Int32)
F:System.Data.SqlClient.SqlBulkCopyOptions.AllowEncryptedValueModifications
M:System.Data.SqlClient.SqlClientFactory.System#IServiceProvider#GetService(System.Type)

Azure Specific Features. Feature port needed.

T:System.Data.SqlClient.PoolBlockingPeriod
P:System.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod

Federated auth https://github.com/dotnet/corefx/issues/8807

T:System.Data.SqlClient.SqlAuthenticationMethod
P:System.Data.SqlClient.SqlConnection.AccessToken
@saurabh500
saurabh500 / gist:a0f980334cb62d79a5dbd0a1cbdd8065
Last active August 23, 2017 07:47
Integrated Auth Setup for Linux

I am outlining the steps for setting up Kerberos on Ubuntu for Integrated Authentication. The Kerberos packages are installed by default on macOS, and the configuration on macOS is the same as Ubuntu. I have tested these steps with Integrated Auth of our development version of SqlClient on Ubuntu1404, 1604 and macOS.

Joining the domain on linux doesn’t guarantee a Kerberos ticket will be generated for use by GSSAPI. The following are the minimum steps necessary to test Integrated Auth on Linux. For further automation where the tickets may need to be renewed on a regular basis or without human intervention, the users can use the KeyTab file.

For Integrated Authentication setup on Linux

  1. Install krb5-user package using apt-get. This would provide the kinit command the configurations needed to interact with Active Directory.

  2. Configure the KDC in krb5.conf file. You could also get the KDC details from the domain controller admin of the organization.

@saurabh500
saurabh500 / RunningEfTestsWithSqlClient.md
Last active March 9, 2018 21:08
Instructions to run the Entity Framework Core tests

The following steps should be followed to run the Entity Framework tests and how to run the tests with modified SqlClient.

  1. Clone the repo https://github.com/aspnet/EntityFrameworkCore/
  2. Build the repo using build.cmd or build.sh depending on the OS you are on.

Make a note of the dotnet path that the build is using. This will be needed to execute specific tests

E.g. In the following the path is C:\Users\sausing.dotnet\x64\dotnet.exe

D:\aspnet\EntityFrameworkCore>build --help