雪铁龙全新c4l 提车:Qt Https sslError问题解决方法
来源:百度文库 编辑:九乡新闻网 时间:2024/04/30 06:39:36
Thread: Qt 4.7 Https?
Thread Tools
Search Thread
Display
27th September 2010 07:04#1
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Qt 4.7 Https?
I was sending request to "https://www.google.com/accounts/OAuthGetRequestToken" using QNetworkAccessManager.
It used to work, but not until I update Qt to 4.7. Now I always get "QNetworkReply::SslHandshakeFailedError" when I try to send that request. And I have already had the openssl dlls inside my app's folder.
How can I solve this problem? Thanks~
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
27th September 2010 11:42#2
tbscope
Expert
Join Date
Jan 2006
Location
Belgium
Posts
1,912
Thanked 263 Times in 263 Posts
Qt products
Platforms
Wiki edits
20
Re: Qt 4.7 Https?
Originally Posted by MorrisLiang
It used to work, but not until I update Qt to 4.7.
You mean "until" and not "but not until" which means "!until" wich is the opposite of "until"
Try this:
Clean the build completely. What does that mean, completely? If you have a build dir, remove it. If you build in the source dir, only keep the source files, all generated files need to be removed. Make clean is not sufficient.
Then rerun qmake and make again.
Does this solve the problem?
Reply With Quote
27th September 2010 13:06#3
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Re: Qt 4.7 Https?
My bad,that grammar kinda confuse me... What I mean is, it works under Qt4.6, but not under 4.7..
Thanks for the reply. Actually, I have dug a little deeper, I checked the QSslError in a slot connected to the QNetworkAccessManager's sslErrors() SIGNAL. The sslError saids that the cert has expired. So I checked the cert by calling QSslError::certificate(), which I found that the cert is Null... I think the manager didn't receive the cert at all...
I have already built the 4.7 with the same configuration when I built 4.6:
configure -fast -debug-and-release -opensource -openssl -I D:\Qt\OpenSSL-Win32\include -L D:\Qt\OpenSSL-Win32 -no-qt3support -no-webkit -no-scripttools -nomake examples -nomake demos -no-script -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -nomake docs
I think the configuration somehow didn't enabled the SSL support... Maybe I need to build the network module again with SSL enabled.
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
27th September 2010 13:53#4
wysota
Master of Zen
Join Date
Jan 2006
Location
Warsaw, Poland
Posts
23,878
Thanks
3
Thanked 3,411 Times in 3,295 Posts
Qt products
Platforms
Blog Entries
4
Wiki edits
9
Re: Qt 4.7 Https?
Connect the sslErrors() signal to ignoreSslErrors() slot.
Your biological and technological distinctiveness will be added to our own. Resistance is futile.
Please ask Qt related questions on the forum and not using private messages or visitor messages.
Reply With Quote
27th September 2010 14:14#5
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Re: Qt 4.7 Https?
If I ignore the error, I can't open the google oauth authorize page...
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
27th September 2010 18:06#6
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Re: Qt 4.7 Https?
I get back to 4.6.2 finally...Maybe we should consider this is a bug or something in 4.7
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
3rd November 2010 08:54#7
Farris
Beginner
Join Date
Jan 2010
Posts
7
Thanked 1 Time in 1 Post
Qt products
Platforms
Re: Qt 4.7 Https?
This is caused by the change in qt 4.7 where root certificates are not included in the qtnetwork module, where as earlier versions of qt shipped with a bundle of common root certificates. If you ensure that proper root certificates, more specifically the one(s) that are used by the host you are attempting to connect to, are installed on the system that you are running from this shouldn't be a problem.
See, http://bugreports.qt.nokia.com/browse/QTBUG-12718 for more info
connecting to the sslError slot and ignoring the ssl error should enable you to connect, although you cannot be sure of the identity of the host you are connecting to.
Thread Tools
Search Thread
Display
27th September 2010 07:04#1
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Qt 4.7 Https?
I was sending request to "https://www.google.com/accounts/OAuthGetRequestToken" using QNetworkAccessManager.
It used to work, but not until I update Qt to 4.7. Now I always get "QNetworkReply::SslHandshakeFailedError" when I try to send that request. And I have already had the openssl dlls inside my app's folder.
How can I solve this problem? Thanks~
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
27th September 2010 11:42#2
tbscope
Expert
Join Date
Jan 2006
Location
Belgium
Posts
1,912
Thanked 263 Times in 263 Posts
Qt products
Platforms
Wiki edits
20
Re: Qt 4.7 Https?
Originally Posted by MorrisLiang
It used to work, but not until I update Qt to 4.7.
You mean "until" and not "but not until" which means "!until" wich is the opposite of "until"
Try this:
Clean the build completely. What does that mean, completely? If you have a build dir, remove it. If you build in the source dir, only keep the source files, all generated files need to be removed. Make clean is not sufficient.
Then rerun qmake and make again.
Does this solve the problem?
Reply With Quote
27th September 2010 13:06#3
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Re: Qt 4.7 Https?
My bad,that grammar kinda confuse me... What I mean is, it works under Qt4.6, but not under 4.7..
Thanks for the reply. Actually, I have dug a little deeper, I checked the QSslError in a slot connected to the QNetworkAccessManager's sslErrors() SIGNAL. The sslError saids that the cert has expired. So I checked the cert by calling QSslError::certificate(), which I found that the cert is Null... I think the manager didn't receive the cert at all...
I have already built the 4.7 with the same configuration when I built 4.6:
configure -fast -debug-and-release -opensource -openssl -I D:\Qt\OpenSSL-Win32\include -L D:\Qt\OpenSSL-Win32 -no-qt3support -no-webkit -no-scripttools -nomake examples -nomake demos -no-script -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -nomake docs
I think the configuration somehow didn't enabled the SSL support... Maybe I need to build the network module again with SSL enabled.
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
27th September 2010 13:53#4
wysota
Master of Zen
Join Date
Jan 2006
Location
Warsaw, Poland
Posts
23,878
Thanks
3
Thanked 3,411 Times in 3,295 Posts
Qt products
Platforms
Blog Entries
4
Wiki edits
9
Re: Qt 4.7 Https?
Connect the sslErrors() signal to ignoreSslErrors() slot.
Your biological and technological distinctiveness will be added to our own. Resistance is futile.
Please ask Qt related questions on the forum and not using private messages or visitor messages.
Reply With Quote
27th September 2010 14:14#5
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Re: Qt 4.7 Https?
If I ignore the error, I can't open the google oauth authorize page...
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
27th September 2010 18:06#6
MorrisLiang
Intermediate user
Join Date
Apr 2010
Posts
98
Thanks
19
Thanked 5 Times in 4 Posts
Qt products
Platforms
Re: Qt 4.7 Https?
I get back to 4.6.2 finally...Maybe we should consider this is a bug or something in 4.7
It's not the goodbye that hurts,but the flashback that follow.
Reply With Quote
3rd November 2010 08:54#7
Farris
Beginner
Join Date
Jan 2010
Posts
7
Thanked 1 Time in 1 Post
Qt products
Platforms
Re: Qt 4.7 Https?
This is caused by the change in qt 4.7 where root certificates are not included in the qtnetwork module, where as earlier versions of qt shipped with a bundle of common root certificates. If you ensure that proper root certificates, more specifically the one(s) that are used by the host you are attempting to connect to, are installed on the system that you are running from this shouldn't be a problem.
See, http://bugreports.qt.nokia.com/browse/QTBUG-12718 for more info
connecting to the sslError slot and ignoring the ssl error should enable you to connect, although you cannot be sure of the identity of the host you are connecting to.
Qt Https sslError问题解决方法
CAD各种问题解决方法(精华)!
CAD各种问题解决方法(精华)
问题解决
问题解决
多普达PPC的一些问题解决方法总汇
79种CAD小问题解决方法
Firefox 挂起(假死)问题解决方法 - Firefox
Coreldraw经常出现的问题解决方法2
Coreldraw经常出现的问题解决方法
HTC T9188 快速GPS下载问题解决方法
Ubuntu vi 方向键出现字母问题解决方法
KTV包房的串音问题解决方法
"http" & "https" -
Chrome浏览器强制http重定向到https的简单方法
Chrome浏览器强制http重定向到https的简单方法
XP系统装SQL SEVER 2005 问题解决 方法总结。
★★★IE问题解决方法汇总!★★★
jQuery 跨域访问问题解决方法_jquery_脚本之家
找不到mysql.sock,mysql.sock丢失问题解决方法
linux qq自动退出关闭的问题解决方法
Qt Embedded Linux移植要点Qt
问题解决方案
问题解决类型