This is an automated email from the ASF dual-hosted git repository.

nju_yaho pushed a commit to tag ebay-3.1.0-release-20200701
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit b0ef8997219e3a363aec863ed1595709b60371a4
Author: Zhong, Yanghong <nju_y...@apache.org>
AuthorDate: Mon Jun 22 15:34:32 2020 +0800

    EBAY-KYLIN-2346 Deal with tls for Windows ODBC
---
 odbc/Common/Common.vcxproj    |  34 +++++------
 odbc/Common/JsonConverter.cpp |  12 ++--
 odbc/Common/QueryCache.cpp    |   1 -
 odbc/Common/REST.cpp          | 131 +++++++++++++++++++++++++-----------------
 odbc/Common/StringUtils.cpp   |   6 ++
 odbc/Common/StringUtils.h     |   1 +
 odbc/Driver/KO_INFO.CPP       |   2 +-
 odbc/Driver/driver.vcxproj    |  45 ++++++++-------
 odbc/README.md                |   5 +-
 odbc/TestDLL/TestDLL.vcxproj  |   7 +--
 10 files changed, 140 insertions(+), 104 deletions(-)

diff --git a/odbc/Common/Common.vcxproj b/odbc/Common/Common.vcxproj
index a9f5cc6b..6087c87 100644
--- a/odbc/Common/Common.vcxproj
+++ b/odbc/Common/Common.vcxproj
@@ -16,7 +16,6 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-
 <Project DefaultTargets="Build" ToolsVersion="4.0" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -40,31 +39,32 @@
     <ProjectGuid>{6EE1C577-1826-4EA2-86AC-FE8047D396A9}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>Common</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" 
Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" 
Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" 
Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
@@ -85,25 +85,25 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(CPPREST_HOME)\Release\include;C:\Program Files (x86)\Visual 
Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);C:\Program 
Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
     <IntDir>$(Platform)\$(Configuration)\</IntDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(CPPREST_HOME)\Release\include;C:\Program Files (x86)\Visual 
Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);C:\Program 
Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(CPPREST_HOME)\Release\include;C:\Program Files (x86)\Visual 
Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);C:\Program 
Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
     <IntDir>$(Platform)\$(Configuration)\</IntDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(CPPREST_HOME)\Release\include;C:\Program Files (x86)\Visual 
Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);C:\Program 
Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
   </PropertyGroup>
   <ItemDefinitionGroup 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -112,7 +112,7 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;_DEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;_DEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
       
<AdditionalIncludeDirectories>$(ZLIB_HOME);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
@@ -133,7 +133,7 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;NDEBUG;_DEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;NDEBUG;_DEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
       
<AdditionalIncludeDirectories>$(ZLIB_HOME);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
@@ -154,7 +154,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;NDEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;NDEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       
<AdditionalIncludeDirectories>$(ZLIB_HOME);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
@@ -177,7 +177,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;NDEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;ASMV;ASMINF;ZLIB_WINAPI;WIN32;NDEBUG;_LIB;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       
<AdditionalIncludeDirectories>$(ZLIB_HOME);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <WholeProgramOptimization>false</WholeProgramOptimization>
diff --git a/odbc/Common/JsonConverter.cpp b/odbc/Common/JsonConverter.cpp
index bdca480..7b9c17f 100644
--- a/odbc/Common/JsonConverter.cpp
+++ b/odbc/Common/JsonConverter.cpp
@@ -20,7 +20,8 @@
 #include "JsonConverter.h"
 
 #define ASSIGN_IF_NOT_NULL(x,y,z)  if(!y.is_null())x=y.z
-#define x_ASSIGN_IF_NOT_NULL(x,y,z)  if(!y.is_null())x=wstring2string(y.z)
+#define x_ASSIGN_IF_NOT_NULL(x,y,z)  if(!y.is_null())x=y.z
+#define w_ASSIGN_IF_NOT_NULL(x,y,z)  if(!y.is_null())x=string2wstring(y.z)
 
 
 TableMeta* TableMetaFromJSON ( web::json::value& object )
@@ -157,7 +158,8 @@ void constructUnflattenResults ( SQLResponse* result, 
web::json::value& o_result
 
             else
             {
-                row -> contents . push_back ( ( jter -> as_string () ) );
+                               string strCell = jter->as_string();
+                               
row->contents.push_back(string2wstring(strCell));
             }
         }
 
@@ -172,7 +174,7 @@ std::unique_ptr <SQLResponse> SQLResponseFromJSON ( 
web::json::value& object )
     result -> affectedRowCount = object[U ( "affectedRowCount" )] . as_integer 
();
     result -> isException = object[U ( "isException" )] . as_bool ();
 
-    ASSIGN_IF_NOT_NULL ( result->exceptionMessage, object[U ( 
"exceptionMessage" )], as_string() );
+    w_ASSIGN_IF_NOT_NULL ( result->exceptionMessage, object[U ( 
"exceptionMessage" )], as_string() );
 
     if ( object[U ( "columnMetas" )] . is_array () )
     {
@@ -190,8 +192,8 @@ std::unique_ptr <SQLResponse> SQLResponseFromJSON ( 
web::json::value& object )
 std::unique_ptr <ErrorMessage> ErrorMessageFromJSON ( web::json::value& object 
)
 {
     std::unique_ptr <ErrorMessage> result ( new ErrorMessage () );
-    ASSIGN_IF_NOT_NULL ( result->url, object[U ( "url" )], as_string() );
-    ASSIGN_IF_NOT_NULL ( result->msg, object[U ( "exception" )], as_string() );
+    w_ASSIGN_IF_NOT_NULL ( result->url, object[U ( "url" )], as_string() );
+    w_ASSIGN_IF_NOT_NULL ( result->msg, object[U ( "exception" )], as_string() 
);
     return result;
 }
 
diff --git a/odbc/Common/QueryCache.cpp b/odbc/Common/QueryCache.cpp
index 5c08d7e..3e17a95 100644
--- a/odbc/Common/QueryCache.cpp
+++ b/odbc/Common/QueryCache.cpp
@@ -19,7 +19,6 @@
 
 #include "QueryCache.h"
 #include <cpprest/http_client.h>
-#include <cpprest/filestream.h>
 #include <cpprest/json.h>
 #include <cpprest/uri.h>
 #include <regex>
diff --git a/odbc/Common/REST.cpp b/odbc/Common/REST.cpp
index a7d3504..d6b60a6 100644
--- a/odbc/Common/REST.cpp
+++ b/odbc/Common/REST.cpp
@@ -18,7 +18,6 @@
 
 
 #include <cpprest/http_client.h>
-#include <cpprest/filestream.h>
 #include <cpprest/json.h>
 #include <cpprest/uri.h>
 #include <string>
@@ -45,6 +44,41 @@ using namespace concurrency::streams;
 using namespace web;
 using namespace web::json;
 
+const string m_certRoot = "C:\\Cert\\";
+const string m_caPath = m_certRoot + "ca-bundle.crt";
+const string m_clientKeyPath = m_certRoot + "host.key";
+const string m_clientCertPath = m_certRoot + "host.crt";
+
+inline bool if_file_exists(const std::string& name) {
+       ifstream f(name.c_str());
+       return f.good();
+}
+
+void SetClientCert(http_client_config& config, string& serverAddr) {
+       if (serverAddr.find_first_of("https") == 0) {
+               if (if_file_exists(m_caPath) && if_file_exists(m_clientKeyPath) 
&& if_file_exists(m_clientCertPath)) {
+                       
config.set_ssl_context_callback([&](boost::asio::ssl::context& ctx) -> void {
+                               ctx.set_default_verify_paths();
+                               try
+                               {
+                                       ctx.load_verify_file(m_caPath);
+                                       
ctx.use_private_key_file(m_clientKeyPath, boost::asio::ssl::context::pem);
+                                       
ctx.use_certificate_file(m_clientCertPath, boost::asio::ssl::context::pem);
+                               }
+                               catch (std::exception& e)
+                               {
+                                       std::stringstream ss;
+                                       ss << "Fail to read config files for 
ssl due to " << e.what();
+                                       throw runtime_error(ss.str());
+                               }
+                               });
+               }
+               else {
+                       config.set_validate_certificates(false);
+               }
+       }
+}
+
 /// <summary>
 /// Find the longest length
 /// </summary>
@@ -133,7 +167,7 @@ void overwrite ( SQLResponse* res )
             case ODBCTypes::ODBC_Type_Time :
             case ODBCTypes::ODBC_Type_Timestamp :
                 length = ScanForLength ( res -> results, i );
-                               if (length > meta -> displaySize) 
+                               if (length > meta -> displaySize)
                                {
                                        meta -> displaySize = length;
                                }
@@ -150,7 +184,7 @@ void overwrite ( SQLResponse* res )
     }
 }
 
-std::wstring completeServerStr ( char* serverStr, long port )
+std::string completeServerStr ( char* serverStr, long port )
 {
     //concat the whole server string
     char completeServerAddr[256];
@@ -174,11 +208,11 @@ std::wstring completeServerStr ( char* serverStr, long 
port )
         strcat ( completeServerAddr, portSuffix );
     }
 
-    return string2wstring ( std::string ( completeServerAddr ) );
+    return std::string(completeServerAddr);
 }
 
 
-http_request makeRequest ( const char* username, const char* passwd, const 
wchar_t* uriStr, http::method method )
+http_request makeRequest ( const char* username, const char* passwd, const 
char* uriStr, http::method method )
 {
     http_request request;
     char s[128];
@@ -186,22 +220,22 @@ http_request makeRequest ( const char* username, const 
char* passwd, const wchar
     std::string b64 = base64_encode ( ( unsigned char const* ) s, strlen ( s ) 
);
     request . set_method ( method );
     request . set_request_uri ( uri ( uri::encode_uri ( uriStr ) ) );
-    request . headers () . add ( header_names::authorization, string2wstring ( 
"Basic " + b64 ) );
+    request . headers () . add ( header_names::authorization, ( "Basic " + b64 
) );
        request . headers () . add ( header_names::accept, "application/json" );
     request . headers () . add ( header_names::content_type, 
"application/json" );
-    request . headers () . add ( header_names::user_agent, "KylinODBCDriver" );
     return request;
 }
 
 bool restAuthenticate ( char* serverAddr, long port, char* username, char* 
passwd )
 {
-    wstring serverAddrW = completeServerStr ( serverAddr, port );
+    string serverAddrX = completeServerStr ( serverAddr, port );
     http_client_config config;
     config . set_timeout ( utility::seconds ( 300 ) );
-       config . set_validate_certificates ( false );
-    http_client session ( serverAddrW, config );
+       SetClientCert(config, serverAddrX);
+
+    http_client session (serverAddrX, config );
     //can get project list only when correct username/password is given
-    http_request request = makeRequest ( username, passwd, 
L"/kylin/api/projects", methods::GET );
+    http_request request = makeRequest ( username, passwd, 
"/kylin/api/projects", methods::GET );
     http_response response = session . request ( request ) . get ();
 
     if ( response . status_code () == status_codes::OK )
@@ -217,12 +251,13 @@ bool restAuthenticate ( char* serverAddr, long port, 
char* username, char* passw
 
 void restListProjects ( char* serverAddr, long port, char* username, char* 
passwd, std::vector <string>& holder )
 {
-    wstring serverAddrW = completeServerStr ( serverAddr, port );
+    string serverAddrX = completeServerStr ( serverAddr, port );
     http_client_config config;
     config . set_timeout ( utility::seconds ( 300 ) );
-       config . set_validate_certificates ( false );
-    http_client session ( serverAddrW, config );
-    http_request request = makeRequest ( username, passwd, 
L"/kylin/api/projects", methods::GET );
+       SetClientCert(config, serverAddrX);
+
+    http_client session (serverAddrX, config );
+    http_request request = makeRequest ( username, passwd, 
"/kylin/api/projects", methods::GET );
     http_response response = session . request ( request ) . get ();
 
     if ( response . status_code () == status_codes::OK )
@@ -231,7 +266,7 @@ void restListProjects ( char* serverAddr, long port, char* 
username, char* passw
 
         for ( auto iter = projects . as_array () . begin (); iter != projects 
. as_array () . end (); ++iter )
         {
-            holder . push_back ( wstring2string ( ( *iter )[U ( "name" )] . 
as_string () ) );
+            holder . push_back (  ( *iter )[U ( "name" )] . as_string () );
         }
 
         if ( holder . size () == 0 )
@@ -256,14 +291,15 @@ void restListProjects ( char* serverAddr, long port, 
char* username, char* passw
 std::unique_ptr <MetadataResponse> restGetMeta ( char* serverAddr, long port, 
char* username, char* passwd,
                                                  char* project )
 {
-    wstring serverAddrW = completeServerStr ( serverAddr, port );
+    string serverAddrX = completeServerStr ( serverAddr, port );
     http_client_config config;
     config . set_timeout ( utility::seconds ( 300 ) );
-       config . set_validate_certificates ( false );
-    http_client session ( serverAddrW, config );
-    std::wstringstream wss;
-    wss << L"/kylin/api/tables_and_columns" << L"?project=" << project;
-    http_request request = makeRequest ( username, passwd, wss . str () . 
c_str (), methods::GET );
+       SetClientCert(config, serverAddrX);
+
+    http_client session (serverAddrX, config );
+    std::stringstream ss;
+    ss << "/kylin/api/tables_and_columns" << "?project=" << project;
+    http_request request = makeRequest ( username, passwd, ss . str () . c_str 
(), methods::GET );
     http_response response = session . request ( request ) . get ();
 
     if ( response . status_code () == status_codes::OK )
@@ -299,14 +335,14 @@ wstring cookQuery ( wchar_t* p )
         if ( p[i] == L'\r' || p[i] == L'\n' || p[i] == L'\t' )
         {
             wss << L' ';
-        } 
-  
+        }
+
         else if (p[i] == L'"')
                {
                        wss << L"\\\"";
                }
 
-               else 
+               else
                {
                        wss << p[i];
                }
@@ -317,18 +353,18 @@ wstring cookQuery ( wchar_t* p )
 
 wstring getBodyString ( http_response& response )
 {
-    bool isGzipped = response . headers () . has ( L"Content-Encoding" );
+    bool isGzipped = response . headers () . has ( "Content-Encoding" );
 
     if ( isGzipped )
     {
         isGzipped = false;
-        http_headers::iterator iterator = response . headers () . find ( 
L"Content-Encoding" );
+        http_headers::iterator iterator = response . headers () . find ( 
"Content-Encoding" );
 
         if ( iterator != response . headers () . end () )
         {
-            wstring contentEncoding = iterator -> second;
+            string contentEncoding = iterator -> second;
 
-            if ( contentEncoding . find ( L"gzip" ) != std::string::npos )
+            if ( contentEncoding . find ( "gzip" ) != std::string::npos )
             {
                 isGzipped = true;
             }
@@ -368,7 +404,7 @@ std::unique_ptr <SQLResponse> convertToSQLResponse ( int 
statusFlag,
     if ( statusFlag == 1 )
     {
         //convert to json
-        web::json::value actualRes = web::json::value::parse ( responseStr );
+        web::json::value actualRes = web::json::value::parse ( 
wstring2string(responseStr) );
         std::unique_ptr <SQLResponse> r = SQLResponseFromJSON ( actualRes );
 
         if ( r -> isException == true )
@@ -383,7 +419,7 @@ std::unique_ptr <SQLResponse> convertToSQLResponse ( int 
statusFlag,
 
     else if ( statusFlag == 0 )
     {
-        std::unique_ptr <ErrorMessage> em = ErrorMessageFromJSON ( 
web::json::value::parse ( responseStr ) );
+        std::unique_ptr <ErrorMessage> em = ErrorMessageFromJSON ( 
web::json::value::parse ( wstring2string(responseStr) ) );
         string expMsg = wstring2string ( em -> msg );
         throw exception ( expMsg . c_str () );
     }
@@ -399,7 +435,7 @@ wstring requestQuery ( wchar_t* rawSql, char* serverAddr, 
long port, char* usern
 {
     //using local cache to intercept probing queries
     const wchar_t* cachedQueryRes = NULL;
-       
+
        if (isPrepare) {
                cachedQueryRes = loadCache ( rawSql  );
        }
@@ -411,41 +447,32 @@ wstring requestQuery ( wchar_t* rawSql, char* serverAddr, 
long port, char* usern
     }
 
     //real requesting
-    wstring serverAddrW = completeServerStr ( serverAddr, port );
+    string serverAddrX = completeServerStr ( serverAddr, port );
     http_client_config config;
     config . set_timeout ( utility::seconds ( 36000 ) );
-       config . set_validate_certificates ( false );
+       SetClientCert(config, serverAddrX);
 
        //uncomment these lines for debug with proxy
        //wstring p = L"http://127.0.0.1:8888";;
        //config.set_proxy(web_proxy(p));
 
-    http_client session ( serverAddrW, config );
+    http_client session (serverAddrX, config );
     http_request request;
-       
-       if (!isPrepare) 
-       {
-               request = makeRequest ( username, passwd, L"/kylin/api/query", 
methods::POST );
-       }
 
-       else
+       if (!isPrepare)
        {
-               request = makeRequest ( username, passwd, 
L"/kylin/api/query/prestate", methods::POST );
+               request = makeRequest ( username, passwd, "/kylin/api/query", 
methods::POST );
        }
 
-    wstring sql = cookQuery ( rawSql );
-    std::wstringstream wss;
-    wss << L"{ \"acceptPartial\": false, \"project\" : \"" << project << L"\", 
" << " \"sql\" : \"" << sql << L"\"";
-       
-       // backward compatible, Apache Kylin <=2.0
-       if (isPrepare)
+       else
        {
-               wss << L", \"params\" : [] ";
+               request = makeRequest ( username, passwd, 
"/kylin/api/query/prestate", methods::POST );
        }
 
-       wss << L"}" ;
-
-    request . set_body ( wss . str (), L"application/json" );
+    string sql = wstring2string(cookQuery ( rawSql ));
+    std::stringstream ss;
+    ss << "{ \"acceptPartial\": false, \"project\" : \"" << project << "\", " 
<< " \"sql\" : \"" << sql << "\" }" ;
+    request . set_body (ss.str(), "application/json" );
     request . headers () . add ( header_names::accept_encoding, "gzip,deflate" 
);
     http_response response;
        http::status_code status;
diff --git a/odbc/Common/StringUtils.cpp b/odbc/Common/StringUtils.cpp
index 151b6d4..20bf29f 100644
--- a/odbc/Common/StringUtils.cpp
+++ b/odbc/Common/StringUtils.cpp
@@ -198,6 +198,12 @@ void wchar2char ( wchar_t* orig, char* dest, int 
destBufferLength )
     wcstombs_s ( &convertedChars, dest, newsize, orig, _TRUNCATE );
 }
 
+std::wstring string2wstring ( const std::string& orig )
+{
+       std::wstring ws;
+       ws.assign(orig.begin(), orig.end());
+       return ws;
+}
 
 std::wstring string2wstring ( std::string& orig )
 {
diff --git a/odbc/Common/StringUtils.h b/odbc/Common/StringUtils.h
index d7f1634..3b9745c 100644
--- a/odbc/Common/StringUtils.h
+++ b/odbc/Common/StringUtils.h
@@ -32,6 +32,7 @@ std::unique_ptr <char[]> wchar2char ( wchar_t* orig );
 std::unique_ptr <char[]> wchar2char ( const wchar_t* orig );
 void wchar2char ( wchar_t* orig, char* dest, int destLength );
 
+std::wstring string2wstring( const std::string& orig);
 std::wstring string2wstring ( std::string& orig );
 std::string wstring2string ( std::wstring& orig );
 
diff --git a/odbc/Driver/KO_INFO.CPP b/odbc/Driver/KO_INFO.CPP
index 94a9c26..c8991e5 100644
--- a/odbc/Driver/KO_INFO.CPP
+++ b/odbc/Driver/KO_INFO.CPP
@@ -1222,7 +1222,7 @@ RETCODE SQL_API _SQLGetTypeInfoBasic ( HSTMT pStmt, SWORD 
pDataType )
     std::unique_ptr <SQLResponse> p;
     try
     {
-        wstring info = 
U("{\"columnMetas\":[{\"isNullable\":0,\"displaySize\":10,\"label\":\"TYPE_NAME\",\"name\":\"TYPE_NAME\",\"schemaName\":null,\"catelogName\":null,\"tableName\":null,\"precision\":128,\"scale\":0,\"columnType\":12,\"columnTypeName\":\"VARCHAR(128)\",\"readOnly\":true,\"writable\":false,\"caseSensitive\":true,\"searchable\":false,\"currency\":false,\"signed\":true,\"autoIncrement\":false,\"definitelyWritable\":false},{\"isNullable\":0,\"displaySize\":5,\"label\":\"DA
 [...]
+        string info = 
U("{\"columnMetas\":[{\"isNullable\":0,\"displaySize\":10,\"label\":\"TYPE_NAME\",\"name\":\"TYPE_NAME\",\"schemaName\":null,\"catelogName\":null,\"tableName\":null,\"precision\":128,\"scale\":0,\"columnType\":12,\"columnTypeName\":\"VARCHAR(128)\",\"readOnly\":true,\"writable\":false,\"caseSensitive\":true,\"searchable\":false,\"currency\":false,\"signed\":true,\"autoIncrement\":false,\"definitelyWritable\":false},{\"isNullable\":0,\"displaySize\":5,\"label\":\"DAT
 [...]
         web::json::value v = web::json::value::parse ( info );
         p = SQLResponseFromJSON ( v );
     }
diff --git a/odbc/Driver/driver.vcxproj b/odbc/Driver/driver.vcxproj
index 415030d..29ef1f1 100644
--- a/odbc/Driver/driver.vcxproj
+++ b/odbc/Driver/driver.vcxproj
@@ -48,37 +48,38 @@
     <SccLocalPath />
     <ProjectGuid>{B43F2DB9-B3B5-4D66-A0E0-D65D3675EAF5}</ProjectGuid>
     <ProjectName>Driver</ProjectName>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" 
Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" 
Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" 
Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" 
Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" 
Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
@@ -112,13 +113,13 @@
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
     <IntDir>$(Platform)\$(Configuration)\Intermediate\</IntDir>
     <LinkIncremental>false</LinkIncremental>
-    
<IncludePath>$(CPPREST_HOME)\Release\include;$(SolutionDir)\Common;C:\Program 
Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;$(SolutionDir)\Common;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
-    
<IncludePath>$(CPPREST_HOME)\Release\include;$(SolutionDir)\Common;C:\Program 
Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;$(SolutionDir)\Common;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
     <IntDir>$(Platform)\$(Configuration)\Intermediate\</IntDir>
   </PropertyGroup>
@@ -126,13 +127,13 @@
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
     <IntDir>$(Platform)\$(Configuration)\Intermediate\</IntDir>
     <LinkIncremental>false</LinkIncremental>
-    
<IncludePath>$(CPPREST_HOME)\Release\include;$(SolutionDir)\Common;C:\Program 
Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;$(SolutionDir)\Common;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>false</LinkIncremental>
-    
<IncludePath>$(CPPREST_HOME)\Release\include;$(SolutionDir)\Common;C:\Program 
Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
-    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
+    
<IncludePath>$(CPPREST_HOME)\Release\include;$(vcpkgRoot)\$(Platform)-windows-static\include;$(SolutionDir)\Common;C:\Program
 Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
+    
<LibraryPath>$(CPPREST_HOME)\Binaries\$(Platform)\$(Configuration);$(vcpkgRoot)\$(Platform)-windows-static\lib;$(SolutionDir)\Common\$(Platform)\$(Configuration);C:\Program
 Files (x86)\Visual Leak 
Detector\lib\Win$(PlatformArchitecture);$(LibraryPath)</LibraryPath>
     <OutDir>$(Platform)\$(Configuration)\</OutDir>
     <IntDir>$(Platform)\$(Configuration)\Intermediate\</IntDir>
   </PropertyGroup>
@@ -154,7 +155,7 @@
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <WarningLevel>Level3</WarningLevel>
       
<AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;SHIPPING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;SHIPPING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
       
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\driver.pch</PrecompiledHeaderOutputFile>
       <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
@@ -182,7 +183,7 @@
       <SubSystem>Console</SubSystem>
       <OutputFile>$(Platform)\$(Configuration)\driver.dll</OutputFile>
       <ImportLibrary>$(Platform)\$(Configuration)\driver.lib</ImportLibrary>
-      
<AdditionalDependencies>odbccp32.lib;odbc32.lib;mswsock.lib;ws2_32.lib;winhttp.lib;cpprest110_2_0.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      
<AdditionalDependencies>legacy_stdio_definitions.lib;odbccp32.lib;odbc32.lib;mswsock.lib;ws2_32.lib;cpprest.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <ModuleDefinitionFile>.\driver.DEF</ModuleDefinitionFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
@@ -202,7 +203,7 @@
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <WarningLevel>Level3</WarningLevel>
       
<AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;SHIPPING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;SHIPPING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
       
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\driver.pch</PrecompiledHeaderOutputFile>
       <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
@@ -229,7 +230,7 @@
       <SubSystem>Console</SubSystem>
       <OutputFile>$(Platform)\$(Configuration)\driver.dll</OutputFile>
       <ImportLibrary>$(Platform)\$(Configuration)\driver.lib</ImportLibrary>
-      
<AdditionalDependencies>odbccp32.lib;odbc32.lib;mswsock.lib;ws2_32.lib;winhttp.lib;cpprest110_2_0.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      
<AdditionalDependencies>legacy_stdio_definitions.lib;odbccp32.lib;odbc32.lib;mswsock.lib;ws2_32.lib;cpprest.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <ModuleDefinitionFile>.\driver.DEF</ModuleDefinitionFile>
     </Link>
     <PostBuildEvent>
@@ -248,7 +249,7 @@
       <MinimalRebuild>true</MinimalRebuild>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
       
<AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
       
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\driver.pch</PrecompiledHeaderOutputFile>
       <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
@@ -278,7 +279,7 @@
       <SubSystem>Console</SubSystem>
       <OutputFile>$(Platform)\$(Configuration)\driver.dll</OutputFile>
       <ImportLibrary>$(Platform)\$(Configuration)\driver.lib</ImportLibrary>
-      
<AdditionalDependencies>cpprest110d_2_0.lib;odbc32.lib;odbccp32.lib;mswsock.lib;ws2_32.lib;winhttp.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      
<AdditionalDependencies>legacy_stdio_definitions.lib;cpprest.lib;odbc32.lib;odbccp32.lib;mswsock.lib;ws2_32.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <ModuleDefinitionFile>.\driver.DEF</ModuleDefinitionFile>
     </Link>
   </ItemDefinitionGroup>
@@ -292,7 +293,7 @@
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       
<AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>CPPREST_FORCE_HTTP_CLIENT_ASIO;_CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_WINDOWS;_USRDLL;driver_EXPORTS;_XML_STREAM_SOCK_CLIENT;_NO_ASYNCRTIMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
       
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\driver.pch</PrecompiledHeaderOutputFile>
       <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
@@ -321,7 +322,7 @@
       <SubSystem>Console</SubSystem>
       <OutputFile>$(Platform)\$(Configuration)\driver.dll</OutputFile>
       <ImportLibrary>$(Platform)\$(Configuration)\driver.lib</ImportLibrary>
-      
<AdditionalDependencies>odbc32.lib;odbccp32.lib;mswsock.lib;ws2_32.lib;winhttp.lib;cpprest110d_2_0.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      
<AdditionalDependencies>legacy_stdio_definitions.lib;odbc32.lib;odbccp32.lib;mswsock.lib;ws2_32.lib;cpprest.lib;Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <ModuleDefinitionFile>.\driver.DEF</ModuleDefinitionFile>
     </Link>
   </ItemDefinitionGroup>
diff --git a/odbc/README.md b/odbc/README.md
index a29e5a3..27bb2f1 100644
--- a/odbc/README.md
+++ b/odbc/README.md
@@ -35,7 +35,7 @@ KylinODBC\Installer(64bit) - Contains a MSI installer for 
kylin odbc driver(x64)
 
 ## Build zlib and Casablanca from source code
 
-KylinODBC uses zlib for data compression and Casablanca as REST client. 
KylinODBC requires its libraries to be static libs, so we need to download 
source codes and compile it manually.  Remember if you want to build 64 bit 
odbc driver, you'll have to build 64 bit dependency libaries, the same goes for 
32 bit. It is recommended that you build Release|x64, Debug|x64, Release|Win32, 
Debug|Win32 for all the libraries.
+KylinODBC uses zlib for data compression and Casablanca as REST 
client(customized g...@github.corp.ebay.com:Kylin/cpprestsdk.git). KylinODBC 
requires its libraries to be static libs, so we need to download source codes 
and compile it manually.  Remember if you want to build 64 bit odbc driver, 
you'll have to build 64 bit dependency libaries, the same goes for 32 bit. It 
is recommended that you build Release|x64, Debug|x64, Release|Win32, 
Debug|Win32 for all the libraries.
 
 ### Set ZLIB_HOME and CPPREST_HOME
 
@@ -55,5 +55,6 @@ Here're some tips when compiling zlib:
 We use Casablanca 2.0.1, like zlib, we need static libs of Casablanca, so 
again we need to compile it manually. Download 2.0.1 source code from code 
repository: 
http://casablanca.codeplex.com/SourceControl/changeset/fa40cc31af293417bb9f25d358a3af576226394a.
 Refer to 
https://katyscode.wordpress.com/2014/04/01/how-to-statically-link-the-c-rest-sdk-casablanca
 to build it.
 
 ### Compile KylinODBC
+Pay additional attention to the preprocessor definition, 
CPPREST_FORCE_HTTP_CLIENT_ASIO, which is for using boost asio for http client 
instead of winhttp.
 
-Open KylinODBC.sln, if you're building a 32 bit ODBC driver, set the profile 
to RELEASE|Win32, build project Installer and find the driver exe at 
Installer/Express/SingleImage/DiskImages/DISK1. If you're building a 64 bit 
driver, set the profile to RELEASE|x64, and find the exe at 
Installer(x64bit)/Express/SingleImage/DiskImages/DISK1.
\ No newline at end of file
+Open KylinODBC.sln with VS2019, if you're building a 32 bit ODBC driver, set 
the profile to RELEASE|Win32, build the modular "Driver". After the dll library 
is generated, openKylinODBC.sln with VS2012, build project Installer and find 
the driver exe at Installer/Express/SingleImage/DiskImages/DISK1. If you're 
building a 64 bit driver, set the profile to RELEASE|x64, and find the exe at 
Installer(x64bit)/Express/SingleImage/DiskImages/DISK1.
diff --git a/odbc/TestDLL/TestDLL.vcxproj b/odbc/TestDLL/TestDLL.vcxproj
index 659cbc2..3cd1f90 100644
--- a/odbc/TestDLL/TestDLL.vcxproj
+++ b/odbc/TestDLL/TestDLL.vcxproj
@@ -16,8 +16,6 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-
-
 <Project DefaultTargets="Build" ToolsVersion="4.0" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -47,18 +45,19 @@
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>TestDLL</RootNamespace>
     <ProjectName>Tests</ProjectName>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" 
Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>

Reply via email to