不用第三方库,怎么实现向https网站post数据? 如题,主要想实现https登陆。请指点! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这里有我Delphi下的提交的例子,好用的。VC下没试过。可做参考。http://blog.csdn.net/zhongguoren666/article/details/6653798http://blog.csdn.net/zhongguoren666/article/details/6653794 本帖最后由 oyljerry 于 2011-12-30 10:50:37 编辑 你这个是http的吧,我要https的啊。 你的也是http的。http的我已经实现了,就是不知道https的怎么实现。 呃 要是可以用openssl的话就 改几行就行了 我试过openssl,但是在连接的时候失败,不知道什么原因,所以才不想用。请问你有用openssl成功发送的例子吗? 哈哈,连接成功了,不过登陆还是失败。我是这样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); 十有八九 是你传入cookie不对了 按如下过程...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,.... MFC子线程调用绘图函数程序会挂 关于CInternetSession的定义范围 一个貌似简单的问题,虽然没分,但求大家帮下忙 关于学习方向的困惑 请教高手,添加控件后对话框无法显示的问题。 大家都进来讨论下,Windows对重要文件的保护是如何实现的? CRichEditCtrl回滚的问题求助! 再次提问,焦点落在一个按钮上,有这么难? 如何获取机器硬件厂商信息? 有什么好的方法截获一个程序是否运行?(最好不用Timer) vc++编辑对话框的id的时候出现资源标识符必须是介于1到32767的整数 CFile::SetLength之后,如何向生成的文件里面写数据
http://blog.csdn.net/zhongguoren666/article/details/6653794
你这个是http的吧,我要https的啊。
我试过openssl,但是在连接的时候失败,不知道什么原因,所以才不想用。请问你有用openssl成功发送的例子吗?
"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);
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,....