POCO C++ Libraries are powerful cross-platform C++ libraries for building network

Overview

alt text

poco-ci CII Best Practices

POCO (Portable Components) C++ Libraries are:

  • A collection of C++ class libraries, conceptually similar to the Java Class Library or the .NET Framework.
  • Focused on solutions to frequently-encountered practical problems.
  • Focused on "internet-age" network-centric applications.
  • Written in efficient, modern, 100% ANSI/ISO Standard C++.
  • Based on and complementing the C++ Standard Library/STL.
  • Highly portable and available on many different platforms, from embedded to server.
  • Open Source, licensed under the Boost Software License.

alt text

To start using POCO, see the Guided Tour and Getting Started documents.

Quick Start (with CMake)

Prerequisites

  • CMake 3.5 or newer
  • A C++14 compiler (Visual C++ 2015, GCC 5.0, Clang 3.4, or newer)
  • OpenSSL headers and libraries (optional, but recommended)
  • MySQL, PostgreSQL and ODBC client libraries (optional)

Most Unix/Linux systems already have OpenSSL preinstalled. If your system does not have OpenSSL, please get it from http://www.openssl.org or another source. You do not have to build OpenSSL yourself - a binary distribution is fine. For example, via Debian APT:

$ apt-get install openssl libssl-dev

On macOS, the easiest way to install OpenSSL is via Homebrew:

$ brew install openssl

The easiest way to install OpenSSL on Windows is to use a binary (prebuild) release, for example the one from Shining Light Productions that comes with a Windows installer.

On Windows, POCO can also use the native Windows TLS APIs (SChannel).

Installing All Dependencies (Linux and macOS)

All dependencies can be installed with the following commands:

Debian Linux (including Ubuntu and Raspbian)

$ sudo apt-get -y update && sudo apt-get -y install git g++ make cmake libssl-dev

RedHat Linux

$ sudo yum install -y git gcc-c++ make cmake3 openssl-devel

macOS (with Homebrew)

$ brew install cmake openssl

Building with CMake (Linux, macOS, Windows)

CMake (version 3.5 or newer) is the recommended build system for building the POCO C++ Libraries.

$ git clone -b master https://github.com/pocoproject/poco.git
$ cd poco
$ mkdir cmake-build
$ cd cmake-build
$ cmake ..
$ cmake --build . --config Release

On macOS, it's necessary to tell CMake where to find the OpenSSL headers and libraries by setting the OPENSSL_ROOT_DIR CMake variable. For example, if OpenSSL has been installed with Homebrew, the cmake invocation becomes:

$ cmake .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl

Other common ways of building with CMake (e.g., cmake-gui) will also work.

There are also a number of project-specific CMake variables that can be changed.

Cross-Compiling

With a proper CMake toolchain file (specified via the CMAKE_TOOLCHAIN_FILE CMake variable), the POCO C++ Libraries can be cross-compiled for embedded Linux systems:

$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/mytoolchain.cmake -DCMAKE_INSTALL_PREFIX=/path/to/target

Installing

The POCO C++ Libraries headers and libraries can be optionally be installed by building the install target.

$ sudo cmake --build . --target install

The default install location is /usr/local/ on Linux and macOS and C:\Program Files (x64)\ on Windows and can be overridden by setting the CMAKE_INSTALL_PREFIX CMake variable.

Building Without CMake

If you do not want to or cannot use CMake, POCO can also be built with Visual Studio (project and solution files included) or GNU Make (Linux, macOS and other supported Unix platforms).

Please refer to the documentation for more information.

Getting POCO via a Package Manager

POCO can also be obtained via different package managers.

Community and Contributing

POCO has an active user and contributing community, please visit our website and blog. Answers to POCO-related questions can also be found on Stack Overflow.

Please see CONTRIBUTING for submitting contributions, bugs reports, feature requests or security issues.

POCO vs. Boost

In regards to Boost, in spite of some functional overlapping, POCO is best thought of as a Boost complement (rather than replacement). Side-by-side use of Boost and POCO is a very common occurrence.

Comments
  • Poco C++ Static Library (Crypto and SSL) Linker Error on OS-X

    Poco C++ Static Library (Crypto and SSL) Linker Error on OS-X

    I have compiled Poco as static library to be used in an XCode6.1.1 Project for a mac application. However I see linking error for libraries: libPocoCrypto.a and libPocoNetSSL.a:

    I have already verified that these libraries are built for x86_64 architecture.

    Linker Error:

    Undefined symbols for architecture x86_64: "_ASN1_STRING_data", referenced from: Poco::Crypto::X509Certificate::extractNames(std::__1::basic_string, std::__1::allocator >&, std::__1::set, std::__1::allocator >, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > > >&) const in libPocoCryptod.a(X509Certificate.o) "_ASN1_STRING_length", referenced from: Poco::Crypto::X509Certificate::extractNames(std::__1::basic_string, std::__1::allocator >&, std::__1::set, std::__1::allocator >, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > > >&) const in libPocoCryptod.a(X509Certificate.o) "_BIO_ctrl", referenced from: Poco::Crypto::X509Certificate::load(std::__1::basic_string, std::__1::allocator > const&) in libPocoCryptod.a(X509Certificate.o) ....

    question 
    opened by AbhinavBansal 86
  • when will the 2.0 release be ready?

    when will the 2.0 release be ready?

    According to the roadmap 2.0 should have been released about two month ago. Is there any Information about this? My project depends on integrating poco as a cmake subproject, so I'm really waiting for 2.0 because I dont want to release something depending on the develop branch.

    Kind regards,

    Tino

    question fixed 
    opened by trusch 45
  • Unable to send email with Poco

    Unable to send email with Poco

    I am trying to use Poco to send an email. I have linked the following dynamic libraries -

    CppUnit.1.dylib, PocoCrypto.30.dylib, PocoData.30.dylib, PocoDataSQLite.30.dylib, PocoFoundation.30.dylib, PocoJSON.30.dylib, PocoMongoDB.30.dylib, PocoNet.30.dylib, PocoNetSSL.30.dylib, PocoUtil.30.dylib, PocoXML.30.dylib, PocoZip.30.dylib.

    I need to use 32 bit version of it, so I ran

    ./configure --omit=Data/ODBC,Data/MySQL --config=Darwin32
    

    This is my code:

    #include "MailSender.hpp"
    
    #include "Poco/Net/MailMessage.h"
    #include "Poco/Net/MailRecipient.h"
    #include "Poco/Net/SMTPClientSession.h"
    #include "Poco/Net/NetException.h"
    #include "Poco/Net/SecureSMTPClientSession.h"
    #include "Poco/Net/InvalidCertificateHandler.h"
    #include "Poco/Net/AcceptCertificateHandler.h"
    #include "Poco/Net/SSLManager.h"
    #include "Poco/Net/SecureStreamSocket.h"
    #include "Poco/Net/MailRecipient.h"
    
    using Poco::Net::InvalidCertificateHandler;
    using Poco::Net::AcceptCertificateHandler;
    using Poco::Net::Context;
    using Poco::Net::SSLManager;
    using Poco::Net::SecureStreamSocket;
    using Poco::Net::SocketAddress;
    using Poco::Net::SecureSMTPClientSession;
    using Poco::Net::SMTPClientSession;
    using Poco::SharedPtr;
    using Poco::Net::MailMessage;
    using Poco::Net::MailRecipient;
    using namespace std;
    
    MailSender::MailSender()
    {
    SharedPtr<InvalidCertificateHandler> pCert = new AcceptCertificateHandler(false);
    
    string host = "smtp.gmail.com";
    int port = 25;
    
    Context::Ptr pContext = new Poco::Net::Context(Context::CLIENT_USE, "", "", "", Context::VERIFY_NONE, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
    SSLManager::instance().initializeClient(0, pCert, pContext);
    
    Poco::Net::SecureSMTPClientSession* pSecure = new Poco::Net::SecureSMTPClientSession(host, port);
    Poco::Net::SecureSMTPClientSession* pSession_ = new Poco::Net::SecureSMTPClientSession(host, port);
    
    SecureStreamSocket* pSSLSocket = new SecureStreamSocket(pContext);
    pSSLSocket->connect(SocketAddress(host, port));
    pSecure = new SecureSMTPClientSession(*pSSLSocket);
    pSession_ = pSecure;
    pSecure->login();
    if (!pSecure->startTLS(pContext))
       throw std::string("Failed to start TLS connection.");
    
    std::string sUserName = "my_email_id";
    std::string sPassword = "my_password";
    
    pSession_->login(SMTPClientSession::AUTH_LOGIN, sUserName, sPassword);
    
    
    string to = "my_email_id";
    string from = "my_email_id";
    string subject = "Your first e-mail message sent using Poco Libraries";
    subject = MailMessage::encodeWord(subject, "UTF-8");
    string content = "Well done! You've successfully sent your first message using Poco SMTPClientSession";
    MailMessage message;
    message.setSender(from);
    message.addRecipient(MailRecipient(MailRecipient::PRIMARY_RECIPIENT, to));
    message.setSubject(subject);
    message.setContentType("text/plain; charset=UTF-8");
    message.setContent(content, MailMessage::ENCODING_8BIT);
    
    
    
    try {
        pSession_->sendMessage(message);
        pSession_->close();
    } catch (Poco::Net::SMTPException &e) {
        qDebug() << e.displayText().c_str() << endl;
    }
    catch (Poco::Net::NetException &e) {
        qDebug() << e.displayText().c_str() << endl;
    }
    
    }
    

    When I run this, my app crashes at runtime, with the following error message on Qt console:

    libc++abi.dylib: terminating with uncaught exception of type Poco::Net::SSLException: SSL Exception
    
    

    The system generated Apple crash report shows something like this:

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib          0x9b7f369a __pthread_kill + 10
    1   libsystem_pthread.dylib         0x90a04f19 pthread_kill + 101
    2   libsystem_c.dylib               0x96861eee abort + 156
    3   libc++abi.dylib                 0x965782f9 abort_message + 169
    4   libc++abi.dylib                 0x9659b483 default_terminate_handler() + 272
    5   libc++abi.dylib                 0x96598ac0 std::__terminate(void (*)()) + 14
    6   libc++abi.dylib                 0x965986ee __cxa_rethrow + 103
    7   libPocoNetSSL.30.dylib          0x02c253ff Poco::Net::SecureSocketImpl::connectSSL(bool) + 943
    8   libPocoNetSSL.30.dylib          0x02c24fee Poco::Net::SecureSocketImpl::connect(Poco::Net::SocketAddress const&, bool) + 94
    9   libPocoNetSSL.30.dylib          0x02c28a61 Poco::Net::SecureStreamSocketImpl::connect(Poco::Net::SocketAddress const&) + 49
    10  libPocoNet.30.dylib             0x02b1368b Poco::Net::StreamSocket::connect(Poco::Net::SocketAddress const&) + 27
    

    The code fails at "pSSLSocket->connect(SocketAddress(host, port));" part.

    How do I fix this? Platform - OS X Yosemite 10.10.2, Qt 5.3.1 32 bit.

    question 
    opened by AttitudeMonger 32
  • Poco 1.12.2 - Building DataMySQL still fails (issue #3689)

    Poco 1.12.2 - Building DataMySQL still fails (issue #3689)

    Poco 1.12.2 Ubuntu 20.04.4 LTS CMake 3.16.3

    Building DataMySQL still fails, issue #3689 @hmartinez82

    Scanning dependencies of target DataMySQL
    [ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Binder.cpp.o
    [ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Connector.cpp.o
    [ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Extractor.cpp.o
    [ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/MySQLException.cpp.o
    [ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/MySQLStatementImpl.cpp.o
    [ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/ResultMetadata.cpp.o
    /home/poco/poco-1.12.2-all/Data/MySQL/src/ResultMetadata.cpp: In function ‘Poco::Data::MetaColumn::ColumnDataType {anonymous}::fieldType(const MYSQL_FIELD&)’:
    /home/poco/poco-1.12.2-all/Data/MySQL/src/ResultMetadata.cpp:136:8: error: ‘MYSQL_TYPE_JSON’ was not declared in this scope; did you mean ‘MYSQL_TYPE_BLOB’?
      136 |   case MYSQL_TYPE_JSON:
          |        ^~~~~~~~~~~~~~~
          |        MYSQL_TYPE_BLOB
    make[2]: *** [Data/MySQL/CMakeFiles/DataMySQL.dir/build.make:128: Data/MySQL/CMakeFiles/DataMySQL.dir/src/ResultMetadata.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:5259: Data/MySQL/CMakeFiles/DataMySQL.dir/all] Error 2
    make: *** [Makefile:163: all] Error 2
    
    # lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 20.04.4 LTS
    Release:        20.04
    Codename:       focal
    
    # cmake --version
    cmake version 3.16.3
    
    # g++ --version
    g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
    
    bug fixed 
    opened by FreelancerCGN 29
  • Using Poco to send email without authentication

    Using Poco to send email without authentication

    A few days back, I raised a question- https://github.com/pocoproject/poco/issues/768 on how to send email with secure authentication via Poco. The final solution worked.

    Is it possible to send email without the auth part? That is, I will just mention the sender's email address (say {user-id}@amazon.com [my corporate Amazon Exchange mail account]), the receiver's address, the attachments and content? I want to skip the smtp server name, username, password (I can provide a port if necessary, but guess it is not needed in absence of host name).

    If so, can anyone guide me how? Almost all examples I have come across don't work, the one in the issue I raised worked after multiple iterations, that's why I am asking.

    question 
    opened by AttitudeMonger 25
  • Strange SocketAddress behavior in OSX

    Strange SocketAddress behavior in OSX

    I just downloaded the latest 1.5.2-release. Creating socket addresses in OSX is behaving very strangely. I have tested various ways of creating a socket address:

    SocketAddress addr1("0.0.0.0:9512");
    addr1.toString(); // returns: 0.2.37.40:0
    SocketAddress addr2("0.0.0.0:1234");
    addr2.toString(); // returns: 0.2.37.40:0
    SocketAddress addr3("192.168.1.1:1234");
    addr3.toString(); // returns: 0.2.4.210:0
    

    I have also tested other constructors:

    int port = 9512;
    IPAddress ip = IPAddress::wildcard(IPAddress:IPv4);
    ip.toString(); // returns 0.0.0.0 (ok!)
    SocketAddress addr(ip, port);
    addr.toString(); // returns 0.2.37.40:0
    

    Simple constructors for other classes cause strange outcomes as well:

    // throws Net Exception: 
    // Address family not supported
    ServerSocket socket(9512); 
    
    // throws Net Exception:
    // Cannot assign requested address: 0.2.37.39:0
    DatagramSocket(9512); 
    
    

    The same code worked as expected in 1.5.1.

    opened by pqvst 25
  • Complete Source IP address binding - combined

    Complete Source IP address binding - combined

    Fixes for:

    • HTTPClientSession to support dual IPv4/IPv6 family when setting source IP address #2271
    • HTTPClientSession not supporting binding source address for proxy connect #2270
    opened by roccocorsi 24
  • Add -DPOCO_HAVE_LIBRESOLV to Linux build configuration

    Add -DPOCO_HAVE_LIBRESOLV to Linux build configuration

    If I start my application with my wifi disabled I get "host not found" for anything like StreamSocket(SocketAddress("google.com:80")). If I let the application running in a loop trying to connect it keeps getting "host not found", that's OK, but when I enable my wifi back the application keeps returning "host not found".

    This doesn't happen if my application starts when my wifi is ON, then turned OFF and ON again. If the application starts with wifi OFF, it doesn't matter whether I turn wifi ON, it simply won't connect.

    enhancement fixed 
    opened by oblitum 24
  • Error when linking 32-bit on a 64-bit machine

    Error when linking 32-bit on a 64-bit machine

    When compiling 32-bit poco on a 64-bit machine (tested on Debian 7), link fails.

    1. The configure script is set with --cflags=-m32
    2. OSARCH_64BITS is set to 0
    3. POCO_TARGET_OSARCH is set to i386

    The compiler creates 32-bit object files, but the -m32 flag is missing from the g++ command when linking the libraries.

    FIX: It can be fixed by adding -m32 to SHLIBFLAGS in build/rules/global in case OSARCH_64BITS==0.

    opened by avishaib 24
  • Zip Decompress Parent Path Injection

    Zip Decompress Parent Path Injection

    By manipulation of the Zip input file header, the contents of the zip archive can be written to an arbitrary parent path of the user.

    Expected behavior

    Throw an exception if filename contains a parent directory reference. isValidPath() (ZipCommon.cpp) should check if the filename contains a tilde character.

    Actual behavior

    By inserting a tilde-slash (~/) in the filename area of the zip header, files can be written to the user's home directory.

    Steps to reproduce the problem

    Use the sample-unzip samle application as follows:

    $ ./sample-unzip -f vuln.zip SOME_OUT_DIR
    

    vuln.zip contains a file foo. foo includes the string bar

    vuln.zip hexdump:

    00000000  50 4b 03 04 0a 00 00 00  00 00 bb 91 5f 4b e9 b3  |PK.........._K..|
    00000010  a2 04 04 00 00 00 04 00  00 00 03 00 1c 00 7e 2f  |..............~/|
    00000020  6f 55 54 09 00 03 52 af  f8 59 4d af f8 59 75 78  |oUT...R..YM..Yux|
    00000030  0b 00 01 04 e8 03 00 00  04 e8 03 00 00 62 61 72  |.............bar|
    00000040  0a 50 4b 01 02 1e 03 0a  00 00 00 00 00 bb 91 5f  |.PK............_|
    00000050  4b e9 b3 a2 04 04 00 00  00 04 00 00 00 03 00 18  |K...............|
    00000060  00 00 00 00 00 01 00 00  00 b4 81 00 00 00 00 66  |...............f|
    00000070  6f 6f 55 54 05 00 03 52  af f8 59 75 78 0b 00 01  |ooUT...R..Yux...|
    00000080  04 e8 03 00 00 04 e8 03  00 00 50 4b 05 06 00 00  |..........PK....|
    00000090  00 00 01 00 01 00 49 00  00 00 41 00 00 00 00 00  |......I...A.....|
    000000a0
    

    After executing the program, a file o with the content bar is written in the home of the user.

    ~/o
    

    (o is just an example name)

    POCO version

    9288e89bfe13e9dbd8c77f558ceb623bf600ceb4

    Compiler and version

    clang version 4.0.1 (tags/RELEASE_401/final)

    Operating system and version

    4.13.9-300.fc27.x86_64 #1 SMP Mon Oct 23 13:41:58 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

    Security implications

    Due to the current behavior of the Zip Decompress mechanism it is possible to write files in parent arbitrary user directories. For example, a manipulated .bashrc could be inserted into the user's home.

    Cheers -Stephan Zeisberg

    bug fixed security 
    opened by stze 22
  • Problems during compilation of Poco on Windows with MinGW and Cywgin

    Problems during compilation of Poco on Windows with MinGW and Cywgin

    Hi,

    I have a project in Qt that works perfectly with Poco libs on linux, I needed to test this project on Windows, so I install Poco on Windows (Virtual Machine).

    First I use Cygwin to compile it and the installation ended perfectly with no error what so ever, how ever when I try to run my project I got so errors that let me believe that something when wrong during the installation of Poco.

    Here are the errors I'm getting

    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:55: error: '_RC_DOWN' 
    was not declared in this scope
       FP_ROUND_DOWNWARD_IMPL   = _RC_DOWN
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:56: error: '_RC_UP' 
    was not declared in this scope
       FP_ROUND_UPWARD_IMPL     = _RC_UP
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:57: error: '_RC_NEAR' 
    was not declared in this scope
        FP_ROUND_TONEAREST_IMPL  = _RC_NEAR
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:58: error: '_RC_CHOP' 
    was not declared in this scope
       FP_ROUND_TOWARDZERO_IMPL = _RC_CHOP
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isInfiniteImpl(float)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:97: error: '_finite' 
    was not declared in this scope
      return _finite(value) == 0;
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isInfiniteImpl(double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:103: error: '_finite' 
    was not declared in this scope
      return _finite(value) == 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isInfiniteImpl(long double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:109: error: '_finite' 
    was not declared in this scope
      return _finite(value) == 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isNaNImpl(float)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:115: error: '_isnan' 
    was not declared in this scope
      return _isnan(value) != 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isNaNImpl(double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:121: error: '_isnan' 
    was not declared in this scope
        return _isnan(value) != 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isNaNImpl(long double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:127: error: '_isnan' 
    was not declared in this scope
      return _isnan(value) != 0;
    

    I also compiled with MinGW, same-thing happened the instalation ended perfectly but when I try to run my project I got the same error.

    Any ideas on what could be causing this error ??

    question 
    opened by Sujamm 21
  • JWT token unitest fail with POCO_NO_SOO on vs 2019

    JWT token unitest fail with POCO_NO_SOO on vs 2019

    Compiler: Visual Studio 2019 community Poco: 1.12.4

    1. Poco: 1.12.4 with POCO_NO_SOO, vs 2019 build failed.
    Poco/Dynamic/VarHolder.h(321,21): error C2248: 'Poco::Placeholder<Po 
    co::Dynamic::VarHolder,64>::pHolder': cannot access private member declared in class 'Poco::Placeholder<Poco::Dynamic::VarHolder,64>' (compiling source file src\Foundation\src\VarIterator.cpp
    
    1. with POCO_NO_SOO, build passed

    JWT unittest failed

    
    TEST_CASE("testParseNoSign", "TokenTest") {
      std::string jwt("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MTYyMzkwMjIsIm5hbWUiOiJKb2huIERvZSIsInN1YiI6IjEyMzQ1Njc4OTAifQ.");
    
      Poco::JWT::Token token(jwt);
    }
    

    Fail to parse JWT string

    opened by longyn 0
  • NetSSL_Win certificate verification failure when intermediate certificates are not available in the Windows trusted store

    NetSSL_Win certificate verification failure when intermediate certificates are not available in the Windows trusted store

    https://github.com/pocoproject/poco/blob/69d15c5dddedf5d9adb86ade0dcee8254bb3ede5/NetSSL_Win/src/SecureSocketImpl.cpp#L1222

    • Poco is passing the hAdditionalStore parameter as null when calling CertGetCertificateChain.
    • When the intermediate certificates are not installed on the machine, looks like hCertStore of the CERT_CONTEXT member needs to be passed as hAdditionalStore parameter to CertGetCertificateChain, for it to be able to build the entire chain.
    • Without this, the created certificate chain seems to contain only the leaf certificate and thus the certificate validation fails
      • It fails to find the back of the chain (in this case leaf itself), in the certificate store.
      • https://github.com/pocoproject/poco/blob/69d15c5dddedf5d9adb86ade0dcee8254bb3ede5/NetSSL_Win/src/SecureSocketImpl.cpp#L1288
    • Windows (Schannel) gives the handle to the store containing intermediate certificates under hCertStore memeber of CERT_CONTEXT certificate obtained from QueryContextAttributes (Schannel)

    Note:

    • Curl and Chromium seems to be passing this hAdditionalStore argument
      • https://chromium.googlesource.com/chromium/src/net/+/master/cert/cert_verify_proc_win.cc#1208
      • https://github.com/curl/curl/blob/master/lib/vtls/schannel_verify.c#L669
    opened by bhatkarthik 0
  • Application crashed while rotating log files in Mac OS M1/M2

    Application crashed while rotating log files in Mac OS M1/M2

    Multiple and constant instances of crashes observed for an application during log rotation. What I did The application was run with sudo command, the application and all the related paths have proper access permissions. The rotation parameters are set as below: logging.channels.c3.archive: number logging.channels.c3.class: FileChannel logging.channels.c3.formatter: f1 logging.channels.c3.path: /var/log/applicationXYZ/applicationXYZ.log logging.channels.c3.purgeCount: 5 logging.channels.c3.rotation: 1M

    Observations: Whenever the log file applicationXYZ.log reaches the it's capacity (here 1M), it tries rotate the file, the application crashes and /bin/launchctl auto launches the application. The log file applicationXYZ.log.0, and execution goes on. Again when log file applicationXYZ.log reaches the it's capacity, the application crashes, and /bin/launchctl auto launches the application. The log files applicationXYZ.log.1 and applicationXYZ.log.0 are created.

    This crash has been observed on MACOS M1/M2 Monterey 12.6.1 / 12.6.1 and Ventura 13.1. POCO Library version: 1.12.4

    I have pasted the contents of crash file below, and it is the same with every other crash file.

    See different crash reports --->

    `Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

    Application Specific Information: dyld2 mode abort() called util(1394,0x104b33e00) malloc: *** error for object 0x7fadfdc16950: pointer being freed was not allocated

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff203c691e __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff203f55bd pthread_kill + 263 2 libsystem_c.dylib 0x00007fff2034a406 abort + 125 3 libsystem_malloc.dylib 0x00007fff2022a165 malloc_vreport + 548 4 libsystem_malloc.dylib 0x00007fff2022d2aa malloc_report + 151 5 libPocoFoundation.94.dylib 0x0000000104c480b7 Poco::FileStreamBuf::~FileStreamBuf() + 135 6 libPocoFoundation.94.dylib 0x0000000104c497e8 Poco::FileOutputStream::~FileOutputStream() + 72 7 libPocoFoundation.94.dylib 0x0000000104bc1efe Poco::LogFile::~LogFile() + 30 8 libPocoFoundation.94.dylib 0x0000000104b75048 Poco::ArchiveByNumberStrategy::archive(Poco::LogFile*) + 56 9 libPocoFoundation.94.dylib 0x0000000104bb42b1 Poco::FileChannel::log(Poco::Message const&) + 97 10 libPocoFoundation.94.dylib 0x0000000104bb8b57 Poco::FormattingChannel::log(Poco::Message const&) + 119 11 util 0x0000000103f5eaa7 main + 9511 12 libdyld.dylib 0x00007fff20410f3d start + 1 `

    `System Integrity Protection: enabled

    Crashed Thread: 0 Dispatch queue: com.apple.main-thread

    Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000

    Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [9734]

    VM Region Info: 0 is not in any region. Bytes before following region: 4378705920 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START --->
    __TEXT 104fdc000-104fec000 [ 64K] r-x/r-x SM=COW ...scan-util

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_platform.dylib 0x190ca708c _platform_memmove + 444 1 libc++.1.dylib 0x190bca564 std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 64 2 libPocoFoundation.94.dylib 0x1056550f8 Poco::ArchiveByNumberStrategy::archive(Poco::LogFile*) + 52 3 libPocoFoundation.94.dylib 0x1056915d4 Poco::FileChannel::log(Poco::Message const&) + 108 4 libPocoFoundation.94.dylib 0x105695918 Poco::FormattingChannel::log(Poco::Message const&) + 112`

    `System Integrity Protection: enabled

    Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

    Application Specific Information: abort() called

    0 libsystem_kernel.dylib 0x183682d98 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1836b7ee0 pthread_kill + 288 2 libsystem_c.dylib 0x1835f2340 abort + 168 3 libc++abi.dylib 0x183672b08 abort_message + 132 4 libc++abi.dylib 0x183662938 demangling_terminate_handler() + 312 5 libobjc.A.dylib 0x183558330 _objc_terminate() + 160 6 libc++abi.dylib 0x183671ea4 std::__terminate(void ()()) + 20 7 libc++abi.dylib 0x183674c1c __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception) + 36 8 libc++abi.dylib 0x183674bc8 __cxa_throw + 140 9 libPocoFoundation.94.dylib 0x10538e140 Poco::FileImpl::handleLastErrorImpl(int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 512 10 libPocoFoundation.94.dylib 0x10538d4b8 Poco::FileImpl::handleLastErrorImpl(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 32 11 libPocoFoundation.94.dylib 0x105390d34 Poco::File::handleLastError(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 12 12 libPocoFoundation.94.dylib 0x1054132fc Poco::FileStreamBuf::open(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned int) + 200 13 libPocoFoundation.94.dylib 0x105414428 Poco::FileOutputStream::FileOutputStream(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned int) + 180 14 libPocoFoundation.94.dylib 0x10539d638 Poco::LogFileImpl::LogFileImpl(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 68 15 libPocoFoundation.94.dylib 0x105391650 Poco::FileChannel::log(Poco::Message const&) + 232 16 libPocoFoundation.94.dylib 0x105395918 Poco::FormattingChannel::log(Poco::Message const&) + 112`

    It is happening with New Poco Library 1.12.4 Only. I have checked with Poco library 1.11.3 with same application, issue not happened. Issue seems to be introduced in version 1.12.4. Can you please help on this issue? @obiltschnig / @aleks-f / @hmartinez82

    opened by hideme4u 1
  • Can't find netssl

    Can't find netssl

    • windows 11
    • cmake 2.25
    • vcpkg 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba

    I've used vcpkg to install poco[core,netssl].

    cmakelists.txt

    cmake_minimum_required(VERSION 3.5)
    
    project(<project-name>)
    
    find_package(Poco REQUIRED COMPONENTS Foundation Net Util)
    
    add_executable(${PROJECT_NAME} <srcs>)
    
    target_include_directories(${PROJECT_NAME}
    PRIVATE
        ${Poco_INCLUDE_DIR}
    )
    
    target_link_libraries(${PROJECT_NAME}
    PRIVATE
        ${Poco_LIBRARIES}
    )
    

    When I use HTTPSClientSession, cmake build failed:

    LINK : fatal error LNK1104: cannot open file 'PocoNetSSLWind.lib'
    

    I check the link command and I find there's no netsslwind.lib linked. BTW the netsslwind.lib file exists. So I want to know how to use HTTPSClientSession?

    opened by JoeyRxy 1
  • Possibly duplicate event firing in `JSONConfiguration.cpp`

    Possibly duplicate event firing in `JSONConfiguration.cpp`

    The propertyChanging event is fired in https://github.com/pocoproject/poco/blob/69d15c5dddedf5d9adb86ade0dcee8254bb3ede5/Util/src/AbstractConfiguration.cpp#L531-L546

    But in setValue of JOSN implementation, the event is fired again. https://github.com/pocoproject/poco/blob/69d15c5dddedf5d9adb86ade0dcee8254bb3ede5/Util/src/JSONConfiguration.cpp#L242-L253

    opened by cangyin 0
Releases(poco-1.11.6-release)
  • poco-1.11.6-release(Dec 16, 2022)

    • GH #3147: Reading from request stream hangs when "Transfer-Encoding: chunked" is used
    • GH #3859: zlib headers not updated
    • GH #3876: Replace sprintf with snprintf in Environment and NumberFormatter to avoid deprecation warnings
    • Build system improvements for Xcode on Apple Silicon.
    • Upgrade bundled SQLite to 3.40.0
    Source code(tar.gz)
    Source code(zip)
  • poco-1.12.4-release(Oct 31, 2022)

    This release upgrades the bundled expat library to release 2.5.0, which fixes CVE-2022-43680, and fixes an issue in PollSet which could lead to 100 % CPU load on single-core systems.

    CHANGELOG

    Source code(tar.gz)
    Source code(zip)
  • poco-1.11.5-release(Oct 31, 2022)

  • poco-1.12.3-release(Oct 24, 2022)

    This release upgrades bundled third-party libraries expat, zlib and SQLite to fix potential vulnerabilities in those. Furthermore, a number of issues have been fixed.

    See the CHANGELOG for details.

    Source code(tar.gz)
    Source code(zip)
  • poco-1.11.4-release(Oct 24, 2022)

  • poco-1.12.2-release(Aug 7, 2022)

  • poco-1.12.1-release(Jul 16, 2022)

  • poco-1.12.0-release(Jul 8, 2022)

    This release introduces Prometheus library.

    Updated bundled external libraries:

    • PCRE to PCRE2 10.40
    • double-conversion to v3.2.0
    • pdjson to latest master

    Issues fixed in this release can be found here.

    Pull requests merged can be found here.

    Source code(tar.gz)
    Source code(zip)
  • poco-1.11.3-release(Jun 12, 2022)

  • poco-1.11.2-release(Apr 17, 2022)

  • poco-1.11.1-release(Nov 5, 2021)

    This is a maintenance release fixing a few issues in 1.11.0 and earlier releases, and upgrading bundled PCRE and SQLite to their latest versions. There are also some minor improvements to the GNU Make and CMake build systems. Upgrading is recommended.

    Issues closed: https://github.com/pocoproject/poco/milestone/39?closed=1

    Source code(tar.gz)
    Source code(zip)
  • poco-1.11.0-release(Jun 28, 2021)

    This release introduces ActiveRecord, a simple and lightweight object-relational mapping (ORM) framework based on the Active Record pattern and the Data library.

    Over 100 issues have been closed with this release. Updated bundled external libraries:

    • expat to 2.4.1
    • PCRE to 8.44
    • pdjson to latest master
    • SQLite to 3.35.5

    Issues closed: https://github.com/pocoproject/poco/milestone/38?closed=1

    Source code(tar.gz)
    Source code(zip)
  • poco-1.10.1-release(Feb 17, 2020)

    This is a maintenance release fixing issues that sneaked into the 1.10.0 release and also adding some minor features that did not make it into 1.10.0. Upgrading is recommended.

    Source code(tar.gz)
    Source code(zip)
  • poco-1.10.0-release(Jan 27, 2020)

  • poco-1.9.4-release(Sep 18, 2019)

  • poco-1.9.3-release(Aug 20, 2019)

  • poco-1.9.2-release(Jul 2, 2019)

    This is a maintenance release that most importantly updates the bundled libexpat XML parser library to release 2.2.7, which fixes a potential vulnerability (CVE-2018-20843). The release also includes fixes to CMake when building on Windows with a Windows 10 SDK (mc.exe not found) and to the caching framework.

    Source code(tar.gz)
    Source code(zip)
  • poco-1.9.1-release(Jun 25, 2019)

  • poco-1.9.0-release(Apr 18, 2018)

Owner
POCO C++ Libraries
POCO C++ Libraries
Device Tree for Poco X3 Pro

Device Tree for Poco X3 Pro Poco X3 Pro (codename: "vayu") is a high-end smartphone from POCO. It was announced and released in March 2021. Device inf

null 2 Feb 11, 2022
A framework for building Mobile cross-platform UI

Weex A framework for building Mobile cross-platform UI. Distribution Support Android 4.1 (API 16), iOS 9.0+ and WebKit 534.30+. platform status Androi

Alibaba 18k Jan 9, 2023
SDK for building cross-platform desktop apps in ANSI-C

NAppGUI Cross-Platform C SDK. Build portable desktop applications for Windows, macOS and Linux, using just C. Quick start in Windows Prerequisites Vis

Francisco García Collado 242 Jan 2, 2023
Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP)

ice_libs Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP) Brief ice_libs is collection of Single-Header C

Rabia Alhaffar 118 Dec 6, 2022
Several single-file, cross-platform, public domain libraries for C/C++ that I use for learning / testing

HTC Several single-file, cross-platform, public domain libraries for C/C++ that I use for learning / testing (Not meant for production code). This is

Chris 19 Nov 5, 2022
The Leap Motion cross-format, cross-platform declarative serialization library

Introduction to LeapSerial LeapSerial is a cross-format, declarative, serialization and deserialization library written and maintained by Leap Motion.

Leap Motion (Ultraleap) 15 Jan 17, 2022
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Alex Dixon 286 Dec 14, 2022
A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language.

Fastcode A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language. FastCode is a procedural/str

null 28 Aug 19, 2022
Powerful automated tool for reverse engineering Unity IL2CPP binaries

Powerful automated tool for reverse engineering Unity IL2CPP binaries

Katy 2.1k Jan 7, 2023
seg's WONDELFUL, INCREDIBLE and POWERFUL 16-bit CPU (:

seg's WONDELFUL, INCREDIBLE and POWERFUL 16-bit CPU (: Not really ): This is just a tiny emulated ISA and CPU with an assembler, a simple debugg

null 18 Nov 8, 2021
Small Extremely Powerful Header Only C++ Lexical Analyzer/String Parser Library

lexpp Small Extremely Powerful Header Only C++ Lexical Analyzer/String Parser Library Lexpp is made with simplicity and size in mind. The entire libra

Jaysmito Mukherjee 49 Jun 21, 2022
Intuitive & Powerful C++20 consteval metaprogramming library(via value).

meta-value-list This library provides a bunch of consteval toolsets to do metaprogramming, and provides the pipeline syntactic sugar for function comb

Netcan 35 Oct 21, 2022
Intuitive & Powerful C++20 consteval metaprogramming library(via value).

meta-list This library provides a bunch of consteval toolsets to do metaprogramming, and provides the pipeline syntactic sugar for function combinatio

Netcan 35 Oct 21, 2022
Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.

Karabiner-Elements Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra or later. Download You can download Karabiner-E

null 15.7k Dec 29, 2022
A powerful duplicate file finder and an enhanced fork of 'fdupes'.

Introduction jdupes is a program for identifying and taking actions upon duplicate files. A WORD OF WARNING: jdupes IS NOT a drop-in compatible replac

Jody Bruchon 1.3k Jan 5, 2023
Read-Compile-Run-Loop: tiny and powerful interactive C++ compiler (REPL)

Read-Compile-Run-Loop: tiny and powerful interactive C++ compiler (REPL) RCRL is a tiny engine for interactive C++ compilation and execution (implemen

Viktor Kirilov 383 Jan 8, 2023
C++ For Creating Powerful Cheating Fortnite

Fortnite External If you want the full version of the source code you have to buy it, if you don't want to buy it you have to build it yourself. This

Achtzehn 76 Jan 4, 2023
C++ For Creating Powerful Cheating Fortnite

Fortnite External If you want the full version of the source code you have to buy it, if you don't want to buy it you have to build it yourself. This

Achtzehn 73 Dec 28, 2022
Quite powerful window manager for X

qpwm quite powerful window manager for X It's small floating window manager from not a programmer ?? Some features ?? Floating only. Fullscreen toggle

unxsh 76 Dec 29, 2022