Comments (61)
看看存储session的 redis 是否配置正确
On Sat, Dec 12, 2015 at 01:28 tsuibin [email protected] wrote:
在github申请了oauth id 和 Secret
填写到configh
重新编译,测试用github登录报错
Authorization callback URL:
http://o2eepicpnet/login/callback/github—
Reply to this email directly or view it on GitHub
#10.
from leanclub.
检查哪一个表?
from leanclub.
redis不需要导入,config 里面 redis IP和 redis master ip填一个就可以了
On Sat, Dec 12, 2015 at 01:40 tsuibin [email protected] wrote:
检查哪一个表?
—
Reply to this email directly or view it on GitHub
#10 (comment).
from leanclub.
config.h里面
只有
#define REDIS_MASTER_IP "127.0.0.1"
这个配置项
from leanclub.
服务器的redis 运行状态
redis 9704 0.0 0.0 40296 3216 ? Ssl Dec10 0:39 /usr/bin/redis-server 127.0.0.1:6379
from leanclub.
redis里面是空的
tsuibin@compiler01:~$ redis-cli
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379>
from leanclub.
...
./src/redis3m/include/redis3m/connection_pool.h: * @param sentinel_port Sentinel port, default 26379
./src/redis3m/include/redis3m/connection_pool.h: unsigned int sentinel_port=26379)
需要修改redis默认端口为26379
from leanclub.
em.. 我这里默认的 6379 没有问题啊。
Auth failed 只在这里出现了
Line 103 in 3a5c1fa
也就是说,POST
https://github.com/login/oauth/access_token
application/x-www-form-urlencoded
"client_id=" + GITHUB_OAUTH_ID +"&client_secret=" + GITHUB_OAUTH_SECRET + "&code=" + code
只有在这里失败了才会触发,你可以下个断点或者print出来github的响应内容调试一下
from leanclub.
好的,今天搞不了了,这空再调一下。
from leanclub.
params.code 打印结果 -1
from leanclub.
em... code 是 -1 的话,应该是 callback 的问题?登录 callback 之后会输出一个静态页面,然后再用一个 ajax 请求
post 你看看浏览器发上去的请求对不对
On Mon, Dec 14, 2015 at 20:39 tsuibin [email protected] wrote:
params.code 打印结果 -1
—
Reply to this email directly or view it on GitHub
#10 (comment).
from leanclub.
Authorization callback URL 填写是对的吗?
http://o2ee.picp.net/login/callback/github
from leanclub.
对,callback 之后应该会有一个 URL 参数叫 "code" ,后面对应了一串字符,会在 ajax 请求里面传上去
from leanclub.
浏览器调试,发现这里带的参数不一样
code 应该是正确获取了
curl 'https://leanclub.org/login/callback/github?code=f3548d77764fe43db7fa&do=1&__t=1450161149170' -H 'accept-encoding: gzip, deflate, sdch' -H 'x-requested-with: XMLHttpRequest' -H 'accept-language: zh-CN,zh;q=0.8' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.8 Safari/537.36' -H 'accept: /' -H 'referer: https://leanclub.org/login/callback/github?code=f3548d77764fe43db7fa' -H 'authority: leanclub.org' -H 'cookie: __cfduid=d1d9a016c400e15cdf596ecc646fbde561449742683; _gat=1; cf_clearance=93dec52dbb1d4936b7c9470a239f8006c2211f95-1450160988-1800; LBSESSIONID=002OPRC8VO5W20O07V781PDMLEDOM601MFETF5T4; _ga=GA1.2.1584022163.1449742691' --compressed
curl 'http://o2ee.picp.net/login/callback/github?code=62fa869c2e036290d575&do=1&__t=1450161083466' -H 'Cookie: _gat=1; _ga=GA1.2.896167595.1450095965' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: zh-CN,zh;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.8 Safari/537.36' -H 'Accept: /' -H 'Referer: http://o2ee.picp.net/login/callback/github?code=62fa869c2e036290d575' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --compressed
from leanclub.
from leanclub.
在代码里面把 params.code 和 params.body 打印出来看一下?
现在看来有可能是你的网络无法连接到 GitHub API 造成的
from leanclub.
@compiler01:~/src/LeanClub/src$ sudo ping www.github.com
[sudo] password for deepin:
PING github.com (192.30.252.130) 56(84) bytes of data.
64 bytes from github.com (192.30.252.130): icmp_seq=1 ttl=48 time=255 ms
64 bytes from github.com (192.30.252.130): icmp_seq=2 ttl=48 time=255 ms
64 bytes from github.com (192.30.252.130): icmp_seq=3 ttl=48 time=255 ms
64 bytes from github.com (192.30.252.130): icmp_seq=4 ttl=48 time=255 ms
^C
--- github.com ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4004ms
rtt min/avg/max/mdev = 255.351/255.646/255.980/0.452 ms
compiler01:~/src/LeanClub/build$ APP Listening on port 18080 with 500 thread(s)
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=3b233888e5efad7d69bf
params.code : -1
params.body : Failed to query.
from leanclub.
curl https://github.com/login/oauth/access_token
curl https://api.github.com/user
或者是,你编译的 libcurl 没有带 HTTPS 支持或者太旧了?
from leanclub.
curl https://github.com/login/oauth/access_token
{"error":"Not Found"}
curl https://api.github.com/user
{
"message": "Requires authentication",
"documentation_url": "https://developer.github.com/v3"
}
from leanclub.
wtf... 好奇怪
LeanClub/src/restclient/restclient.cpp
Lines 247 to 252 in 3a5c1fa
你在这里把 curl 返回的错误输出一下试试?
from leanclub.
if (res != CURLE_OK)
{
ret.body = "{'error':'Not Found'}";
ret.code = -1;
return ret;
}
改成这个样还是?
from leanclub.
不是。。把 res 输出出来
from leanclub.
@compiler01:~/src/LeanClub/build$ APP Listening on port 18080 with 500 thread(s)
ret body:
ret code:0
from leanclub.
https://github.com/typcn/LeanClub/blob/master/src/restclient/restclient.cpp#L246
在 res = curl_easy_perform(curl);
后面,加一行 printf('CURL ERROR: %s',curl_easy_strerror(res));
from leanclub.
compiler01:~/src/LeanClub/build$ ./leanclub
APP Listening on port 18080 with 500 thread(s)
CURL ERROR: Problem with the SSL CA cert (path? access rights?)client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=a99a7308d2f723736505
-1
Failed to query.
from leanclub.
看样子是 SSL 证书错误? 尝试升级 openssl 版本,libcurl 版本,升级 ca-certs 然后重新编译试试?
或者直接把 github 的证书手动下载加入信任
from leanclub.
compiler01:~/src/LeanClub/build$ curl -V
curl 7.42.1 (x86_64-pc-linux-gnu) libcurl/7.42.1 GnuTLS/3.3.15 zlib/1.2.8 libidn/1.30 libssh2/1.5.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
奇怪啊
from leanclub.
看看 /etc/pki/tls/certs/ 是否有内容?
重新安装一下 ca-certificates 试试?
from leanclub.
/etc/pki/tls/certs/ 无内容
系统安装的debian sid
from leanclub.
apt-get install ca-certificates
from leanclub.
已经reinstall
证书在
/etc/ssl/certs
下面的证书很多
00673b5b.0 81b9768f.0 dd8e9d41.0
02265526.0 82223c44.0 Deutsche_Telekom_Root_CA_2.pem
024dc131.0 8317b10c.0 DigiCert_Assured_ID_Root_CA.pem
02b73561.0 8470719d.0 DigiCert_Assured_ID_Root_G2.pem
03179a64.0 84cba82f.0 DigiCert_Assured_ID_Root_G3.pem
034868d6.0 85cde254.0 DigiCert_Global_Root_CA.pem
039c618a.0 861a399d.0 DigiCert_Global_Root_G2.pem
03cdb807 861e0100.0 DigiCert_Global_Root_G3.pem
03f2b8cf.0 86212b19.0 DigiCert_High_Assurance_EV_Root_CA.pem
04f60c28.0 876f1e28.0 DigiCert_Trusted_Root_G4.pem
052e396b.0 87753b0d.0 Digital_Signature_Trust_Co._Global_CA_1.pem
062cdee6.0 882de061.0 Digital_Signature_Trust_Co.Global_CA_3.pem
064e0aa9.0 8867006a.0 DST_ACES_CA_X6.pem
080911ac.0 88f89ea7.0 DST_Root_CA_X3.pem
0810ba98.0 895cad1a.0 D-TRUST_Root_Class_3_CA_2_2009.pem
08aef7bb.0 89c02a45.0 D-TRUST_Root_Class_3_CA_2_EV_2009.pem
09789157.0 8b59b1ad.0 e113c810.0
0b1b94ef.0 8c24b137.0 e18bfb83.0
0ba01d19.0 8d6437c3.0 e268a4c5.0
0c4c9b6c.0 8d86cdd1.0 e2799e36.0
0d1b923b.0 8e52d3cd.0 e36a6752.0
0d69c7e1.0 9007ae68.0 e442e424.0
0dad9736.0 91739615.0 e48193cf.0
10531352.0 9282e51c.0 e536d871.0
106f3e4d.0 930ac5d2.0 e60bf0c0.0
111e6273.0 9339512a.0 e775ed2d.0
116bf586.0 93bc0acc.0 e7b8d656.0
119afc2e.0 9576d26b.0 e8651083.0
11f154d6.0 95aff9e3.0 e8de2f56.0
124bbd54.0 961f5451.0 ea169617.0
128805a3.0 9685a493.0 eb375c3e.0
12d55845.0 9772ca32.0 EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem
157753a5.0 988a38cb.0 ec87c655.0
1636090b.0 9ab62355.0 EC-ACC.pem
1676090a.0 9c2e7d30.0 ed39abd0.0
17b51fe6.0 9c472bf7.0 ed62f4e3.0
1874d4aa.0 9c8dfbd4.0 ee1365c0.0
18856ac4.0 9d04f354.0 ee64a828.0
19c1fa33.0 9d520b32.0 ee7cd6fb.0
1d3472b9.0 9d6523ce.0 ee90b008.0
1dac3003.0 9dbefe7b.0 EE_Certification_Centre_Root_CA.pem
1dcd6f4c.0 9ec3a561.0 eed8c118.0
1df5a75f.0 9f533518.0 ef2f636c.0
1e08bfd1.0 9f541fb4.0 ef954a4e.0
1e09d511.0 a0bc6fbb.0 Entrust.net_Premium_2048_Secure_Server_CA.pem
1e1eab7c.0 a15b3b6b.0 Entrust_Root_Certification_Authority-EC1.pem
1e8e7201.0 a2c66da8.0 Entrust_Root_Certification_Authority-G2.pem
1eb37bdf.0 a2df7ad7.0 Entrust_Root_Certification_Authority.pem
1ec4d31a.0 a3896b44.0 ePKI_Root_Certification_Authority.pem
1f58a078.0 a5fd78f0.0 Equifax_Secure_CA.pem
21855f49.0 a6a593ba.0 Equifax_Secure_eBusiness_CA_1.pem
219d9499.0 a7605362.0 Equifax_Secure_Global_eBusiness_CA.pem
2251b13a.0 a760e1bd.0 E-Tugra_Certification_Authority.pem
23f4c490.0 a7d2cf64.0 f060240e.0
244b5494.0 a8dee976.0 f081611a.0
24ad0b63.0 a94d09e5.0 f30dd6ad.0
27af790d.0 ab5346f4.0 f3377b1b.0
2ab3b959.0 ACCVRAIZ1.pem f387163d.0
2add47b6.0 ACEDICOM_Root.pem f39fc864.0
2ae6433e.0 AC_Raíz_Certicámara_S.A..pem f559733c.0
2afc57aa.0 Actalis_Authentication_Root_CA.pem f58a60fe.0
2b349938.0 ad088e1d.0 f61bff45.0
2c543cd1.0 add67345.0 f80cc7f6.0
2d9dafe4.0 AddTrust_External_Root.pem f90208f7.0
2e4eed3c.0 AddTrust_Low-Value_Services_Root.pem fac084d7.0
2e5ac55d.0 AddTrust_Public_Services_Root.pem facacbc6.0
2edf7016.0 AddTrust_Qualified_Certificates_Root.pem fb126c6d.0
2fa87019.0 ae8153b9.0 fc5a8f99.0
33815e15.0 ae8153b9.1 fcac10e3.0
33815e15.1 aeb67534.0 fde84897.0
343eb6cb.0 aee5f10d.0 ff588423.0
349f2832.0 AffirmTrust_Commercial.pem ff783690.0
35105088.0 AffirmTrust_Networking.pem GeoTrust_Global_CA_2.pem
3513523f.0 AffirmTrust_Premium_ECC.pem GeoTrust_Global_CA.pem
381ce4dd.0 AffirmTrust_Premium.pem GeoTrust_Primary_Certification_Authority-G2.pem
399e7759.0 ApplicationCA-Japanese_Government.pem GeoTrust_Primary_Certification_Authority-G3.pem
3a3b02ce.0 Atos_TrustedRoot_2011.pem GeoTrust_Primary_Certification_Authority.pem
3ad48a91.0 A-Trust-nQual-03.pem GeoTrust_Universal_CA_2.pem
3b2716e5.0 Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem GeoTrust_Universal_CA.pem
3bde41ac.0 b0e59380.0 Global_Chambersign_Root-2008.pem
3c58f906.0 b0ed035a.0 GlobalSign_ECC_Root_CA-R4.pem
3c6676aa.0 b0f3e76e.0 GlobalSign_ECC_Root_CA-R5.pem
3c860d51.0 b1159c4c.0 GlobalSign_Root_CA.pem
3c9a4d3b.0 b13cc6df.0 GlobalSign_Root_CA-R2.pem
3d441de8.0 b1b8a7f3.0 GlobalSign_Root_CA-R3.pem
3e45d192.0 b204d74a.0 Go_Daddy_Class_2_CA.pem
3e7271e8.0 b3fb433b.0 Go_Daddy_Root_Certificate_Authority-G2.pem
3ee7e181.0 b42ff584.0 Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem
3efd4dc0.0 b66938e9.0 Hongkong_Post_Root_CA_1.pem
40547a79.0 b6c5745d.0 IdenTrust_Commercial_Root_CA_1.pem
40dc992e.0 b727005e.0 IdenTrust_Public_Sector_Root_CA_1.pem
415660c1.0 b7a5b843.0 IGC_A.pem
415660c1.1 b7db1890.0 Izenpe.com.pem
418595b9.0 b7e7231a.0 Juur-SK.pem
4304c5e5.0 b872f2b4.0 Microsec_e-Szigno_Root_CA_2009.pem
442adcac.0 b8e83700.0 Microsec_e-Szigno_Root_CA.pem
450c6e38.0 ba89ed3b.0 NetLock_Arany=Class_Gold=Főtanúsítvány.pem
455f1b52.0 bad35b78.0 NetLock_Business=Class_B=Root.pem
46b2fd3b.0 Baltimore_CyberTrust_Root.pem NetLock_Express=Class_C=Root.pem
480720ec.0 bb2d49a0.0 NetLock_Notary=Class_A=Root.pem
48a195d8.0 bc3f2570.0 NetLock_Qualified=Class_QA=Root.pem
48bec511.0 bd1910d4.0 Network_Solutions_Certificate_Authority.pem
4a6481c9.0 bdacca6f.0 OISTE_WISeKey_Global_Root_GA_CA.pem
4be590e0.0 bf64f35b.0 PSCProcert.pem
4bfab552.0 Buypass_Class_2_CA_1.pem QuoVadis_Root_CA_1_G3.pem
4e18c148.0 Buypass_Class_2_Root_CA.pem QuoVadis_Root_CA_2_G3.pem
4f316efb.0 Buypass_Class_3_CA_1.pem QuoVadis_Root_CA_2.pem
4fbd6bfa.0 Buypass_Class_3_Root_CA.pem QuoVadis_Root_CA_3_G3.pem
5021a0a2.0 c01cdfa2.0 QuoVadis_Root_CA_3.pem
5046c355.0 c089bbbd.0 QuoVadis_Root_CA.pem
524d9b43.0 c0ff1f52.0 Root_CA_Generalitat_Valenciana.pem
5273a94c.0 c19d42c7.0 RSA_Security_2048_v3.pem
52b525c7.0 c215bc69.0 Secure_Global_CA.pem
5443e9e3.0 c28a8a30.0 SecureSign_RootCA11.pem
54657681.0 c3a6a9ad.0 SecureTrust_CA.pem
5620c4aa.0 c47d9980.0 Security_Communication_EV_RootCA1.pem
56657bde.0 c491639e.0 Security_Communication_RootCA2.pem
56b8a0b6.0 c51c224c.0 Security_Communication_Root_CA.pem
56e29e75.0 c527e4ab.0 SG_TRUST_SERVICES_RACINE.pem
57692373.0 c5d3212a.0 Sonera_Class_1_Root_CA.pem
578d5c04.0 c5e082db.0 Sonera_Class_2_Root_CA.pem
57bbd831.0 c7e2a638.0 spi-cacert-2008.pem
57bcb2da.0 c8763593.0 ssl-cert-snakeoil.pem
58a44af1.0 c8841d13.0 Staat_der_Nederlanden_EV_Root_CA.pem
592c0a9a.0 c90bc37d.0 Staat_der_Nederlanden_Root_CA-G2.pem
594f1775.0 c99398f3.0 Staat_der_Nederlanden_Root_CA-G3.pem
5a250ea7.0 c9f83a1c.0 Staat_der_Nederlanden_Root_CA.pem
5a3f0ff8.0 ca6e4ad9.0 Starfield_Class_2_CA.pem
5a4d6896.0 ca-certificates.crt Starfield_Root_Certificate_Authority-G2.pem
5a5372fc.0 CA_Disig.pem Starfield_Services_Root_Certificate_Authority-G2.pem
5ad8a5d6.0 CA_Disig_Root_R1.pem StartCom_Certification_Authority_2.pem
5c44d531.0 CA_Disig_Root_R2.pem StartCom_Certification_Authority_G2.pem
5cd81ad7.0 Camerfirma_Chambers_of_Commerce_Root.pem StartCom_Certification_Authority.pem
5cf9d536.0 Camerfirma_Global_Chambersign_Root.pem S-TRUST_Authentication_and_Encryption_Root_CA_2005_PN.pem
5d63b0ae.0 cb156124.0 S-TRUST_Universal_Root_CA.pem
5e4e69e7.0 cb357862.0 Swisscom_Root_CA_1.pem
5f15c80c.0 cb59f961.0 Swisscom_Root_CA_2.pem
5f47b495.0 cbeee9e2.0 Swisscom_Root_EV_CA_2.pem
607986c7.0 cbf06781.0 SwissSign_Gold_CA-G2.pem
60afe812.0 cc450945.0 SwissSign_Platinum_CA-G2.pem
631c779f.0 ccc52f49.0 SwissSign_Silver_CA-G2.pem
635ccfd5.0 cd58d51e.0 Taiwan_GRCA.pem
63a2c897.0 cdaebb72.0 TC_TrustCenter_Class_2_CA_II.pem
6410666e.0 Certigna.pem TC_TrustCenter_Class_3_CA_II.pem
653b494a.0 Certinomis-Autorité_Racine.pem TC_TrustCenter_Universal_CA_I.pem
65b876bd.0 Certplus_Class_2_Primary_CA.pem TeliaSonera_Root_CA_v1.pem
667c66d4.0 certSIGN_ROOT_CA.pem thawte_Primary_Root_CA-G2.pem
67495436.0 Certum_Root_CA.pem thawte_Primary_Root_CA-G3.pem
67d559d1.0 Certum_Trusted_Network_CA.pem thawte_Primary_Root_CA.pem
69105f4f.0 cf701eeb.0 Trustis_FPS_Root_CA.pem
6b99d060.0 cfa1c2ee.0 T-TeleSec_GlobalRoot_Class_2.pem
6e8bf996.0 CFCA_EV_ROOT.pem T-TeleSec_GlobalRoot_Class_3.pem
6f2c1157.0 Chambers_of_Commerce_Root-2008.pem TÜBİTAK_UEKAE_Kök_Sertifika_Hizmet_Sağlayıcısı-Sürüm_3.pem
6fcc125d.0 China_Internet_Network_Information_Center_EV_Certificates_Root.pem TURKTRUST_Certificate_Services_Provider_Root_1.pem
706f604c.0 CNNIC_ROOT.pem TURKTRUST_Certificate_Services_Provider_Root_2007.pem
72f369af.0 Comodo_AAA_Services_root.pem TURKTRUST_Certificate_Services_Provider_Root_2.pem
72fa7371.0 COMODO_Certification_Authority.pem TWCA_Global_Root_CA.pem
749e9e03.0 COMODO_ECC_Certification_Authority.pem TWCA_Root_Certification_Authority.pem
74c26bd0.0 COMODO_RSA_Certification_Authority.pem USERTrust_ECC_Certification_Authority.pem
755f7420.0 Comodo_Secure_Services_root.pem USERTrust_RSA_Certification_Authority.pem
75680d2e.0 Comodo_Trusted_Services_root.pem UTN_DATACorp_SGC_Root_CA.pem
75d1b2ed.0 ComSign_CA.pem UTN_USERFirst_Email_Root_CA.pem
7651b327.0 ComSign_Secured_CA.pem UTN_USERFirst_Hardware_Root_CA.pem
7651b327.1 Cybertrust_Global_Root.pem Verisign_Class_1_Public_Primary_Certification_Authority-G2.pem
76579174.0 d06393bb.0 Verisign_Class_1_Public_Primary_Certification_Authority-G3.pem
7672ac4b.0 d16a5865.0 Verisign_Class_1_Public_Primary_Certification_Authority.pem
76cb8f92.0 d18e9066.0 Verisign_Class_2_Public_Primary_Certification_Authority-G2.pem
76faf6c0.0 d4c339cb.0 Verisign_Class_2_Public_Primary_Certification_Authority-G3.pem
778e3cb0.0 d4dae3dd.0 Verisign_Class_3_Public_Primary_Certification_Authority_2.pem
790a7190.0 d59297b8.0 Verisign_Class_3_Public_Primary_Certification_Authority-G2.pem
7999be0d.0 d6325660.0 Verisign_Class_3_Public_Primary_Certification_Authority-G3.pem
79ad8b43.0 d64f06f3.0 VeriSign_Class_3_Public_Primary_Certification_Authority-G4.pem
7a481e66.0 d66b55d9.0 VeriSign_Class_3_Public_Primary_Certification_Authority-G5.pem
7a819ef2.0 d7746a63.0 Verisign_Class_3_Public_Primary_Certification_Authority.pem
7d0b38bd.0 d78a75c7.0 Verisign_Class_4_Public_Primary_Certification_Authority-_G3.pem
7d453d8f.0 d7e8dc79.0 VeriSign_Universal_Root_Certification_Authority.pem
7d5a75e4.0 d853d49e.0 Visa_eCommerce_Root.pem
7f3d5d1d.0 d957f522.0 WellsSecure_Public_Root_Certificate_Authority.pem
8096d0a9.0 d9d12c58.0 WoSign_China.pem
812e17de.0 dbc54cab.0 WoSign.pem
8160b96c.0 dc45b0bd.0 XRamp_Global_CA_Root.pem
from leanclub.
往 /etc/pki/tls/certs/ 创建个符号链接?
from leanclub.
compiler01:~/src/LeanClub/build$ ls /etc/pki/tls/cert -l
lrwxrwxrwx 1 root root 14 Dec 15 15:32 /etc/pki/tls/cert -> /etc/ssl/certs
问题依旧
APP Listening on port 18080 with 500 thread(s)
CURL ERROR: Problem with the SSL CA cert (path? access rights?)client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=e3527baa36c868525908
-1
Failed to query.
from leanclub.
WTF。。。 你把 NSS 的 libcurl 换成 openssl 的 libcurl 试下?
from leanclub.
make clean之后
重新编译
ompiler01:~/src/LeanClub/build$ ./leanclub
APP Listening on port 18080 with 500 thread(s)
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=7d541a40b85e3f2548e4
200
access_token=4d55b6eb2ca37c42963c5ce30c4263fb9da10dea&scope=user%3Aemail&token_type=bearer
(2015-12-15 07:35:38) [ERROR ] An uncaught exception occurred: std::exception
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=d2be8ef7bde5933ec8eb
200
access_token=4d55b6eb2ca37c42963c5ce30c4263fb9da10dea&scope=user%3Aemail&token_type=bearer
(2015-12-15 07:35:49) [ERROR ] An uncaught exception occurred: std::exception
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=d2be8ef7bde5933ec8eb
200
error=bad_verification_code&error_description=The+code+passed+is+incorrect+or+expired.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23bad-verification-code
from leanclub.
userinfo.body 有内容了么?
from leanclub.
libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007fbeda4ea000)
from leanclub.
compiler01:~/src/LeanClub/build$ ./leanclub
APP Listening on port 18080 with 500 thread(s)
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=4e07ab819f1a948bf849
200
access_token=4d55b6eb2ca37c42963c5ce30c4263fb9da10dea&scope=user%3Aemail&token_type=bearer
(2015-12-15 07:39:49) [ERROR ] An uncaught exception occurred: std::exception
from leanclub.
compiler01:~/src/LeanClub/build$ ./leanclub
APP Listening on port 18080 with 500 thread(s)
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=e0cd09a0ac6841c38e89
200
access_token=4d55b6eb2ca37c42963c5ce30c4263fb9da10dea&scope=user%3Aemail&token_type=bearer
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=e0cd09a0ac6841c38e89
200
error=bad_verification_code&error_description=The+code+passed+is+incorrect+or+expired.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23bad-verification-code
from leanclub.
compiler01:~/src/LeanClub/build$ ./leanclub
APP Listening on port 18080 with 500 thread(s)
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=912605e8f598c46bdc17
login
body : access_token=4d55b6eb2ca37c42963c5ce30c4263fb9da10dea&scope=user%3Aemail&token_type=bearer
userinfo.body: {"login":"tsuibin","id":1154966,"avatar_url":"https://avatars.githubusercontent.com/u/1154966?v=3","gravatar_id":"","url":"https://api.github.com/users/tsuibin","html_url":"https://github.com/tsuibin","followers_url":"https://api.github.com/users/tsuibin/followers","following_url":"https://api.github.com/users/tsuibin/following{/other_user}","gists_url":"https://api.github.com/users/tsuibin/gists{/gist_id}","starred_url":"https://api.github.com/users/tsuibin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsuibin/subscriptions","organizations_url":"https://api.github.com/users/tsuibin/orgs","repos_url":"https://api.github.com/users/tsuibin/repos","events_url":"https://api.github.com/users/tsuibin/events{/privacy}","received_events_url":"https://api.github.com/users/tsuibin/received_events","type":"User","site_admin":false,"name":"tsuibin","company":"o2ee","blog":"http://www.o2ee.com","location":"China","email":"[email protected]","hireable":true,"bio":null,"public_repos":93,"public_gists":0,"followers":13,"following":5,"created_at":"2011-10-27T06:22:35Z","updated_at":"2015-12-09T02:14:30Z"}
(2015-12-15 07:48:44) [ERROR ] An uncaught exception occurred: std::exception
正确获取了数据,但是异常了
from leanclub.
CURL ERROR: Couldn't connect to serverret body:
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=912605e8f598c46bdc17
body : Failed to query.
from leanclub.
网页上面显示什么?只是 500 么?
if(reg.code == 201){
return json;
}else{
return "register failed";
}
看看这里的是否正常返回了 201?
如果正常返回了的话,可能就是创建 session 并存入 redis 逻辑出了点问题
from leanclub.
网页显示超时要刷新
刷新之后
显示 Auth failed Please re-login
在获取到github返回的数据之后
等待一段时间
报:
(2015-12-15 07:48:44) [ERROR ] An uncaught exception occurred: std::exception
CURL ERROR: Couldn't connect to serverret body:
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=912605e8f598c46bdc17
body : Failed to query.
client_id=2df2cd6dd216d3726a72&client_secret=cbebee19c1fd7b082f4086ed1ca3a3e6f9d9e7c6&code=912605e8f598c46bdc17
login
body : error=bad_verification_code&error_description=The+code+passed+is+incorrect+or+expired.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23bad-verification-code
from leanclub.
Code 只能使用一次,刷新之后再提交肯定会失败
关键是第一次超时的原因
from leanclub.
数据库有记录
录入成功了
Source
{
"_id": "8225FBF27323636DF6F2933C6B7DA8F44BB810A0",
"_rev": "1-4bf2b37cbc951acab2a81127a2fd61ae",
"regTime": 1450164938,
"status": 0,
"lastLogin": 1450164938,
"avatar": "https://cn.gravatar.com/avatar/4761e01b5d8bd1ea04f2aadfefc909ec?d=identicon",
"type": 1,
"username": "github_tsuibin",
"points": 0,
"uid": "8225FBF27323636DF6F2933C6B7DA8F44BB810A0"
}
等是界面没有显示为已登陆的界面
from leanclub.
那应该就是 redis 有点问题。。
from leanclub.
看看有没有 cookie ,以及 redis 是否有数据
from leanclub.
奇葩的是有
compiler01:~/src/LeanClub/build$ redis-cli
127.0.0.1:6379> keys *
- "SESS67G4TWTMAJAOWYE90XTW89TLQYLI0L80DTFS3JZ1"
- "SESSF69FB8QSH5T0UQMLXHTJZ3PTHF24GA6UJ078XWPU"
from leanclub.
你把 SetSession("test") 单独执行一下试试?就是放到异步逻辑之外,这样出错应该会自动断下来,方便调试
from leanclub.
浏览器 里面的cookies
有_ga
_gat
这两项
_gat是1
_ga是GA一串数字
from leanclub.
那个只是 google 统计, setsession 函数只是存储一些数据,然后返回 cookie 头部 作为 string ,所以你执行他一下,看看能不能正常返回
from leanclub.
程序里面没有调用过 SetSession这个函数
from leanclub.
https://github.com/typcn/LeanClub/blob/master/src/main.cpp#L292 这里,既然已经存入了 redis ,肯定这个函数被调用了,
from leanclub.
找到,在route的 /中 加入了
SetSession("test");
没有任何反应阿
from leanclub.
那没有登录成功就很奇怪啊。。
SESSION_COOKIE_DOMAIN 设置正确了么?尝试把函数返回值输出试试?
from leanclub.
#define SESSION_COOKIE_DOMAIN "o2ee.picp.net"
from leanclub.
cookies 好像没有设置成功
浏览器调式里面也看不到加入的test
from leanclub.
把 SetSession 函数的返回值输出一下,SetSession 函数并不会真正的设置 cookie ,只是返回 set-cookie ,header 的值
from leanclub.
LBSESSIONID=NAEPF34YUAB2OV6GH6XK2F06UMR727T67Z56KDA0; expires=Wed, 14-Dec-2016 09:57:26 GMT; path=/; domain=picp.net; HttpOnly; Secure
result是
set session!{"avatar":"https://cn.gravatar.com/avatar/4761e01b5d8bd1ea04f2aadfefc909ec?d=identicon","username":"github_tsuibin","uid":"8225FBF27323636DF6F2933C6B7DA8F44BB810A0"}
from leanclub.
把 secure 的 flag 去掉即可。。 secure 是仅限 HTTPS
from leanclub.
ok,登陆成功
然而,新的问题来了
from leanclub.
Related Issues (14)
- reserved identifier violation HOT 1
- 搜索 HOT 2
- 发布新的主题 Please post on offical site HOT 4
- 附件上传后无法显示 HOT 14
- Online: Read failed
- https访问失败 HOT 1
- 关于 crow::json::wvalue rtx转json string的问题 HOT 1
- Compiled failed. HOT 1
- debian 安装 couchdb 然后访问/_utils/index.html页面报错 HOT 6
- 添加了一个数据库自动初始化脚本init_database.sh HOT 1
- config.h中 DATABASE_USERNAME 和 DATABASE_PASSWORD如何配置? HOT 8
- [ERROR ] An uncaught exception occurred: invalid json object HOT 2
- 如何修改绑定IP 127.0.0.1:18080 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leanclub.