Skip to content

Commit

Permalink
- Added TLS 1.2 support (#6)
Browse files Browse the repository at this point in the history
* - Added TLS 1.2 support
- Fixed TargetFrameworks from net45 to net46

* Updated SecurityProtocol value

* Changed to SecurityProtocolType  0xC00 to Tls12
  • Loading branch information
Trivident authored and JoanM committed Apr 5, 2018
1 parent 7865e63 commit 78b851a
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,4 @@ $RECYCLE.BIN/

# Visual Studio 2014 CTP
**/*.sln.ide
/.vs/byndercsharpsdk/v15/Server/sqlite3
9 changes: 4 additions & 5 deletions Bynder/Api/Bynder.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<!-- Other properties can be inserted here -->
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -109,12 +109,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 2 additions & 0 deletions Bynder/Api/Impl/Oauth/OauthRequestSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
Expand Down Expand Up @@ -51,6 +52,7 @@ public OauthRequestSender(Credentials credentials, string baseUrl)
_baseUrl = baseUrl;
_httpClient = new HttpClient(new OAuthMessageHandler(credentials, new HttpClientHandler()));
_httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls12;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Bynder/Api/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net46" />
</packages>
8 changes: 5 additions & 3 deletions Bynder/Models/Bynder.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -74,7 +74,9 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
Expand Down
2 changes: 1 addition & 1 deletion Bynder/Models/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net46" />
</packages>
15 changes: 8 additions & 7 deletions Bynder/Test/App.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="TOKEN" value="LOGIN_TOKEN"/>
<add key="TOKEN_SECRET" value="LOGIN_TOKEN_SECRET"/>
<add key="CONSUMER_KEY" value="CONSUMER_KEY"/>
<add key="CONSUMER_SECRET" value="CONSUMER_SECRET"/>
<add key="API_BASE_URL" value="http://localhost:8890/"/>
<add key="TOKEN" value="LOGIN_TOKEN" />
<add key="TOKEN_SECRET" value="LOGIN_TOKEN_SECRET" />
<add key="CONSUMER_KEY" value="CONSUMER_KEY" />
<add key="CONSUMER_SECRET" value="CONSUMER_SECRET" />
<add key="API_BASE_URL" value="http://localhost:8890/" />
</appSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /></startup>
</configuration>
8 changes: 6 additions & 2 deletions Bynder/Test/Bynder.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="HTTPResponses\User.txt">
Expand Down
8 changes: 4 additions & 4 deletions Bynder/Test/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net452" />
<package id="Moq" version="4.5.28" targetFramework="net452" />
<package id="Moq.Sequences" version="1.0.1.0" targetFramework="net452" />
<package id="NUnit" version="3.5.0" targetFramework="net452" />
<package id="Castle.Core" version="3.3.3" targetFramework="net46" />
<package id="Moq" version="4.5.28" targetFramework="net46" />
<package id="Moq.Sequences" version="1.0.1.0" targetFramework="net46" />
<package id="NUnit" version="3.5.0" targetFramework="net46" />
</packages>

0 comments on commit 78b851a

Please sign in to comment.