I am having an issue with SQL Server assemblies that have to make an API call to an outside service, SmartyStreets. I've created a DLL which references the SmartyStreets DLL. This new DLL will take address fields, call the API and return a varchar(max).
When testing in VS, I created a basic form for input addresses, it would call the DLL and then populate a text box with the results. My new DLL works.
I created the assembly for the SmartySteets DLL and it is set as follows:
CREATE ASSEMBLY SmartyStreets from 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\smartystreets-dotnet-sdk.dll' WITH PERMISSION_SET = UNSAFE;
I created the assembly for my DLL (which references the SmartyStreets DLL) as follows:
CREATE ASSEMBLY SmartyStreets_API from 'C:\Program Files\Microsoft SQL Server\MSSQL14.HMARK\MSSQL\Binn\SmartyStreetsDLL.dll' WITH PERMISSION_SET = UNSAFE;
The function was created:
CREATE function CLR_AddressStandardization (
@sAddress1 nvarchar(max)
, @sAddress2 nvarchar(max)
, @sCity nvarchar(max)
, @sState nvarchar(max)
, @sZIP nvarchar(max)
, @sCountry nvarchar(max)) returns nvarchar(max)
EXTERNAL NAME SmartyStreets_API.[SmartyStreetsDLL.SSDLL].StandardizeAddress
Now I call the new function:
select dbo.CLR_AddressStandardization('18600 Malyn','','Fraser','MI','48026','')
It returns with "Error: The request was aborted: Could not create SSL/TLS secure channel."
I believe that something is preventing the SmartyStreets DLL the ability to make a call outside, but I dont know how to address this.
Any ideas?