File indexing completed on 2024-10-06 12:48:07
0001 /* 0002 Copyright (C) 2007 Justin Karneges <justin@affinix.com> 0003 0004 Permission is hereby granted, free of charge, to any person obtaining a copy 0005 of this software and associated documentation files (the "Software"), to deal 0006 in the Software without restriction, including without limitation the rights 0007 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 0008 copies of the Software, and to permit persons to whom the Software is 0009 furnished to do so, subject to the following conditions: 0010 0011 The above copyright notice and this permission notice shall be included in 0012 all copies or substantial portions of the Software. 0013 0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0017 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 0020 */ 0021 0022 #include "tlssocket.h" 0023 0024 #include <QCoreApplication> 0025 0026 int main(int argc, char **argv) 0027 { 0028 QCA::Initializer init; 0029 QCoreApplication qapp(argc, argv); 0030 0031 TLSSocket socket; 0032 socket.connectToHostEncrypted(QStringLiteral("www.paypal.com"), 443); 0033 socket.write("GET / HTTP/1.0\r\n\r\n"); 0034 while (socket.waitForReadyRead()) 0035 printf("%s", socket.readAll().constData()); 0036 0037 return 0; 0038 }