How to fix [DBNETLIB]ConnectionOpen (SECDoClientHandshake()) SSL Security error CODE 80004005

I have recently have this issue on SQL Server 2012 with Windows Server 2012 R2.

The error was displayed one using OLE DP Provider in the VB script connection strings.
After looking at various google post explaining this issue nothing has worked.

To confirm the server is PCI DSS compliant and TLS 1.0 < and SSL are disabled.

I have changed the connection string from

‘connstring = “Provider=SQLOLEDB.1;

to

connstring = “Provider=SQLNCLI11;

this is to use native SQL Client Drivers to connect.

This has worked and no more issues the script complained.

Some background:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50131

Connection Strings for SQL Server 2012

https://www.connectionstrings.com/sql-server-2012/

https://www.connectionstrings.com/sql-server-native-client-11-0-oledb-provider/

How to install SqlServerCmdletSnapin100 and SqlServerProviderSnapin100 – guide

How to Install Missing PowerShell Snap ins when you get

Add-PSSnapin : No spans-ins have been registered for Windows Powershell Version

Check if PSSnapin are already installed

get-PSSnapin –registered

If empty, then follow the process below.

Open up the following sites and download the following

https://www.microsoft.com/en-us/download/details.aspx?id=16978

Make sure you are downloading 64bit version for 64-bit powershell version

Microsoft® System CLR Types for SQL Server® 2008 R2

X64 Package (SQLSysClrTypes.msi)

Microsoft® Windows PowerShell Extensions for SQL Server® 2008 R2

X64 Package (PowerShellTools.msi)

Microsoft® SQL Server® 2008 R2 Shared Management Objects

X64 Package (SharedManagementObjects.msi)

Once installed

Check this location for files

C:\Program Files\Microsoft SQL Server\100\Tools\Binn\Redist

Or here

C:\Program Files\Microsoft SQL Server\100\Tools\Binn\

You need to find the following files

Microsoft.SqlServer.Management.PSProvider.dll

Microsoft.SqlServer.Management.PSSnapins.dll

 

Very important for 64bit version use 64 bit version of framework.

Issue the following to check which version of framework your powershell is running

 

PS S:\> [environment]::version

 

Major  Minor  Build  Revision

—–  —–  —–  ——–

4      0      30319  42000

 

You need to point to v4 of framework or version v2 depends on your result and to a correct bit version!

The below is for .Net 2.0 Version

For 32bit use

set-alias installutil C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil

for 64 bit use

set-alias installutil C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil

In this case my version of .net is 4 so I need to use the following

set-alias installutil C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil

then to the following

installutil -i “c:\Program Files\Microsoft SQL Server\100\Tools\Binn\Redist\Microsoft.SqlServer.Management.PSProvider.dll”

installutil -i “c:\Program Files\Microsoft SQL Server\100\Tools\Binn\Redist\Microsoft.SqlServer.Management.PSSnapins.dll”

 

If it does not install for any reason then make sure that your installutil point to the correct 32/64 bit version and to the correct framework. If this is not correct your installation will fail

Then issue the following

Add-PSSnapin SqlServerCmdletSnapin100

Add-PSSnapin SqlServerProviderSnapin100

And check

get-PSSnapin –registered

Name        : SqlServerCmdletSnapin100

PSVersion   : 2.0

Description : This is a PowerShell snap-in that includes various SQL Server cmdlets.

 

Name        : SqlServerProviderSnapin100

PSVersion   : 2.0

Description : SQL Server Provider

Any issues please let me know 🙂

 

 

How to fix Fix the hostname does not match the server certificate error in bitnami redmine

if you are having the following error in Bitnami Redmine or just Redmine

Email delivery error: hostname “your domain” does not match the server certificate then you can fix it by adding the following to the config.

This is sometime ok if you are using smtp relay and don’t need to have the certification.

To fix this problem edit the following file

vim /opt/bitnami/apps/redmine/htdocs/config/configuration.yml

default:
delivery_method: :smtp
smtp_settings:
address: your_server_sending_emails
port: 25
domain: your_domain
authentication: :none
user_name:
password:
    openssl_verify_mode: ‘none’

Make sure that is under smtp settings (use spaces insted of tabs in this config file) then you can reload the bitnami

./ctlscript.sh restart apache