diff --git a/shadowsocks-csharp/Config.cs b/shadowsocks-csharp/Config.cs index 23a0a942..d8d77571 100755 --- a/shadowsocks-csharp/Config.cs +++ b/shadowsocks-csharp/Config.cs @@ -48,7 +48,7 @@ namespace shadowsocks_csharp { server = "127.0.0.1", server_port = 8388, - local_port = 1081, + local_port = 1080, password = "barfoo!", method = "table", isDefault = true diff --git a/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs b/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs index 1a7909d7..5645a934 100644 --- a/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs +++ b/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs @@ -14,7 +14,13 @@ namespace shadowsocks_csharp.Encrypt {"aes-256-cfb", new int[]{32, 16}}, {"bf-cfb", new int[]{16, 8}}, {"rc4", new int[]{16, 0}}, - }; + }; + + static OpensslEncryptor() + { + OpenSSL.OpenSSL_add_all_ciphers(); + } + public OpensslEncryptor(string method, string password) : base(method, password) { @@ -85,7 +91,6 @@ namespace shadowsocks_csharp.Encrypt private void InitKey(string method, string password) { - OpenSSL.OpenSSL_add_all_ciphers(); method = method.ToLower(); string k = method + ":" + password; _cipher = OpenSSL.EVP_get_cipherbyname(System.Text.Encoding.UTF8.GetBytes(method));