UsePostgreSQLDatabase()
If OpenDatabase(0, "host=<my server>.amazonaws.com port=5432 dbname=<my_database>", "<my_user>", "<my_password>")
Debug "Connected to PostgreSQL"
Else
Debug "Connection failed: "+DatabaseError()
EndIf
Connection failed: connection to server at "<my server>.rds.amazonaws.com" (35.1xx.1xx.2xx), port 5432 failed: FATAL: no pg_hba.conf entry for host "1xx.xx.xxx.54", user "postgres", database "<my db>", no encryption
The first answer: you got in the reply: you have to add your IP to the allowed hosts in pg_hba.conf
The second answer: you may need secured access, which is not possible with PB at the moment.
For this I have written a postgres proxy. But I can not open source the code.
Last edited by infratec on Sun Mar 03, 2024 5:48 pm, edited 1 time in total.
As I wrote above, my IP is in the clear as I can connect to the AWS server from the SAME machine using anything but Purebasic.
You probably have a point in regards to security. I have chosen the simplest, most insecure option in the AWS user interface but it might still not allow 'zero' security if that's what PB does here.
infratec wrote: Sun Mar 03, 2024 10:35 am
The first answer: you got in the reply: you have to add your IP tothe allewd hosts in pg_hba.conf
The second answer: you may need secured access, which is not possible with PB at the moment.
For this I have written a postgres proxy. But I can not open source the code.
To initiate an SSL-encrypted connection, the frontend initially sends an SSLRequest message rather than a StartupMessage. The server then responds with a single byte containing S or N, indicating that it is willing or unwilling to perform SSL, respectively. The frontend might close the connection at this point if it is dissatisfied with the response. To continue after S, perform an SSL startup handshake (not described here, part of the SSL specification) with the server. If this is successful, continue with sending the usual StartupMessage. In this case the StartupMessage and all subsequent data will be SSL-encrypted. To continue after N, send the usual StartupMessage and proceed without encryption. (Alternatively, it is permissible to issue a GSSENCRequest message after an N response to try to use GSSAPI encryption instead of SSL.)