|
|
Comments and Discussions
|
|
 |

|
Hello everyone,
I like this application and I would love to use it. I type into the window https://myclient.php and the application does not get through to the server. I don't know if I am doing something wrong or if there is something in the code that I need to change. Please let me know because I would love to use this application for HTTPS. Thanks. Zeljko
|
|
|
|

|
I am using SSL library from platform SDK:
..\Microsoft Platform SDK\Samples\WinBase\Security\SSL
TomazZ
|
|
|
|

|
Use this link to solve https problem:
http://support.microsoft.com/kb/q182888/
BR
Zsolt
|
|
|
|

|
When i go to above link, i did follow code in that link, but it get error with error code = 10035
--------------------------
ERP VN: www.erpvn.net
|
|
|
|

|
I modified that code below:
int times = 0;
DWORD dwError = 0;
Again:
// SEND REQUEST
if(!::HttpSendRequest( _hRequest, // handle by returned HttpOpenRequest
NULL, // additional HTTP header
0, // additional HTTP header length
NULL, // additional data in HTTP Post or HTTP Put
0) // additional data length
)
{
// James modified
dwError = ::GetLastError();
times++;
if (times < 10)// && dwError == ERROR_INTERNET_INVALID_CA)
{
if (_bAskInstallCert) // Show Dlg
{
DWORD dwNetErr = 0;
// Make sure to check return code from InternetErrorDlg
// user may click either OK or Cancel. In case of Cancel
// request should not be resumbitted.
dwNetErr = InternetErrorDlg (GetDesktopWindow(),
_hRequest,
//ERROR_INTERNET_INVALID_CA,
dwError,
FLAGS_ERROR_UI_FILTER_FOR_ERRORS |
FLAGS_ERROR_UI_FLAGS_GENERATE_DATA |
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS,
NULL);
switch(dwNetErr){
case ERROR_INTERNET_FORCE_RETRY:
printf("Interne force retry\n");
break;
case ERROR_CANCELLED:
printf("Cancelled\n");
times = 10; // Stop
break;
case ERROR_SUCCESS:
printf("Success\n");
break;
}
goto Again;
}
else // without Dlg
{
DWORD dwNetErr = 0;
DWORD dwFlags;
DWORD dwBuffLen = sizeof(dwFlags);
InternetQueryOption (_hRequest, INTERNET_OPTION_SECURITY_FLAGS,
(LPVOID)&dwFlags, &dwBuffLen);
dwFlags |= SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_CN_INVALID ;
if ( !InternetSetOption (_hRequest, INTERNET_OPTION_SECURITY_FLAGS,
&dwFlags, sizeof (dwFlags) ) )
printf("Set Option failed errcode: %ld\n", GetLastError());
goto Again;
}
}
--------------------------
ERP VN: www.erpvn.net
|
|
|
|

|
:-OSet the W3Client::w3https W3Client::reqPost in your code as follow:
client.Connect("ServerName",Port,NULL,NULL,W3Client::w3https);
client.Request("ObjFile", W3Client::reqPost)
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Synchronized/asynchronized WWW client: HTTP/HTTPS GET, POST, POST multiparts/form-data supported. FTP GET FILE, PUT FILE supported too.
| Type | Article |
| Licence | CPOL |
| First Posted | 3 May 2004 |
| Views | 179,407 |
| Bookmarked | 80 times |
|
|