Skip to content

Cannot connect to the postgresql server X.X.X.X: could not send SSL negotiation packet #94

Description

@dmlvc

Hi! Trying to establish connection with remote PG server got error "Warning: cannot connect to the postgresql server X.X.X.X: could not send SSL negotiation packet: Resource temporarily unavailable". Same result for "li run main.cc" and local CMake build. pgcli works fine with the same connection parameters.

    auto db = pgsql_database(
            s::host = "xxx.xxx.xxx.xxx", // Hostname or ip of the database server
            s::database = "my-services",  // Database name
            s::user = "admin", // Username
            s::password = "admin", // Password
            s::port = 31357, // Port
            s::charset = "utf8", // Charset
            // Only for async connection, specify the maximum number of SQL connections per thread.
            s::max_async_connections_per_thread = 200,
            // Only for synchronous connection, specify the maximum number of SQL connections
            s::max_sync_connections = 2000);

    auto countries_orm = sql_orm_schema(db, "sys.country")
            .fields(
                    s::id(s::auto_increment, s::primary_key) = int(),
                    s::code = std::string(),
                    s::code_3 = std::string(),
                    s::code_dig = std::string(),
                    s::name = std::string(),
                    s::name_engl = std::string(),
                    s::note = std::string()
            );

    auto countries = countries_orm.connect();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions