Can not connect to postgres SQL SSL handshake

i got this error when re deploying

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] fail: Program[0]

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] An error occurred while migrating the database

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] Npgsql.NpgsqlException (0x80004005): Exception while performing SSL handshake

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] ---> System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](CancellationToken cancellationToken)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|215_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.UnpooledDataSource.Get(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|45_0(Boolean async, CancellationToken cancellationToken)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.NpgsqlConnection.Open()

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists()

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)

2023-04-07T20:27:17.954 app[a2758cde] hkg [info] at Program.<Main>$(String[] args) in /app/API/Program.cs:line 82

i know it cause by postgres server what happen

Our Postgres works over an internal, encrypted network. It does not support SSL (that would be a second layer of encryption). Your driver should have an option to disable SSL, it seems like it’s trying to require an SSL connection when it shouldn’t be.

it working, thank you very much <3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.