如题,主要想实现https登陆。请指点!

解决方案 »

  1.   

    这里有我Delphi下的提交的例子,好用的。VC下没试过。可做参考。http://blog.csdn.net/zhongguoren666/article/details/6653798
    http://blog.csdn.net/zhongguoren666/article/details/6653794
      

  2.   

    本帖最后由 oyljerry 于 2011-12-30 10:50:37 编辑
      

  3.   


    你这个是http的吧,我要https的啊。
      

  4.   

    你的也是http的。http的我已经实现了,就是不知道https的怎么实现。
      

  5.   

    呃 要是可以用openssl的话就 改几行就行了
      

  6.   


    我试过openssl,但是在连接的时候失败,不知道什么原因,所以才不想用。请问你有用openssl成功发送的例子吗?
      

  7.   

    哈哈,连接成功了,不过登陆还是失败。我是这样post的:string szbuf="POST /09_member/passCheck.php HTTP/1.1\r\n"
    "Accept: application/x-shockwave-flash, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-silverlight, */*\r\n"
    "Referer: http://www.sealonline.co.kr/index.html\r\n"
    "Accept-Language: zh-cn\r\n"
    "Content-Type: application/x-www-form-urlencoded\r\n"
    "Accept-Encoding: gzip, deflate\r\n"
    "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; EmbeddedWB 14.52 from: http://www.bsalsa.com/ EmbeddedWB 14.52; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C)\r\n"
    "Host: https://security.sealonline.co.kr\r\n"
    "Content-Length: 104\r\n"
    "Connection: Keep-Alive\r\n"
    "Cache-Control: no-cache\r\n"
    "Cookie: __utma=51261174.1737061756.1325164437.1325164437.1325164437.1; __utmb=51261174.4.10.1325164437; __utmz=51261174.1325164437.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=51261174\r\n\r\n"
    "gotoUrlPage=http%3A%2F%2Fwww.sealonline.co.kr%2Findex.html%3F&LoginID=userid&LoginPWD=pwd&x=36&y=13\r\n";  err = SSL_write (ssl, szbuf.c_str(), szbuf.length());  CHK_SSL(err);
      

  8.   

    十有八九 是你传入cookie不对了
      

  9.   

    按如下过程...SSL_CTX* ctx;
    SSL* ssl;
    SSLeay_add_ssl_algorithms();
    SSL_load_error_strings();
    ctx = SSL_CTX_new (SSLv23_client_method());ssl = SSL_new (ctx);
    SSL_set_fd (ssl, sock);
    SSL_connect (ssl);SSL_write (ssl,....