File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . Net ;
3
4
using System . Windows . Forms ;
4
5
5
6
namespace TwitterClient
@@ -12,6 +13,7 @@ static class Program
12
13
[ STAThread ]
13
14
static int Main ( string [ ] args )
14
15
{
16
+ ServicePointManager . SecurityProtocol = SecurityProtocolTypeExtensions . Tls11 | SecurityProtocolTypeExtensions . Tls12 ;
15
17
if ( args . Length == 0 ) return 1 ;
16
18
if ( args [ 0 ] == "--config" )
17
19
{
Original file line number Diff line number Diff line change
1
+ namespace System . Net
2
+ {
3
+ using System . Security . Authentication ;
4
+ public static class SecurityProtocolTypeExtensions
5
+ {
6
+ public const SecurityProtocolType Tls12 = ( SecurityProtocolType ) SslProtocolsExtensions . Tls12 ;
7
+ public const SecurityProtocolType Tls11 = ( SecurityProtocolType ) SslProtocolsExtensions . Tls11 ;
8
+ public const SecurityProtocolType SystemDefault = ( SecurityProtocolType ) 0 ;
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ namespace System . Security . Authentication
2
+ {
3
+ public static class SslProtocolsExtensions
4
+ {
5
+ public const SslProtocols Tls12 = ( SslProtocols ) 0x00000C00 ;
6
+ public const SslProtocols Tls11 = ( SslProtocols ) 0x00000300 ;
7
+ }
8
+ }
Original file line number Diff line number Diff line change 10
10
<AppDesignerFolder >Properties</AppDesignerFolder >
11
11
<RootNamespace >TwitterClient</RootNamespace >
12
12
<AssemblyName >sstwitter</AssemblyName >
13
- <TargetFrameworkVersion >v2.0 </TargetFrameworkVersion >
13
+ <TargetFrameworkVersion >v3.5 </TargetFrameworkVersion >
14
14
<FileAlignment >512</FileAlignment >
15
15
</PropertyGroup >
16
16
<PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Debug|x86' " >
51
51
<Compile Include =" OAuthBase.cs" />
52
52
<Compile Include =" Program.cs" />
53
53
<Compile Include =" Properties\AssemblyInfo.cs" />
54
+ <Compile Include =" SecurityProtocolTypeExtensions.cs" />
55
+ <Compile Include =" SslProtocolsExtensions.cs" />
54
56
<Compile Include =" Twitter.cs" />
55
57
<Compile Include =" TwitterToken.cs" />
56
58
<Compile Include =" WebClient.cs" />
You can’t perform that action at this time.
0 commit comments