Im having trouble connecting to the postgresql server via npgsql on .net maui. I added the crt certificate but i connect from windows and cant connect from android. I read that adding this line to the server pg_hba file last line can help
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
The error is “Exception while performing SSL handshake”
innerExeption “Exception of type ‘Interop+AndroidCrypto+SslException’ was thrown.”
Windows has no problem but the same connection string doesnt work in android.
I downloaded the crt ssl certificate thats available in the connection page of the control panel of the website and im trying to use that but its not working :(
Hi there,
What is the exact error that you get when you try to connect? If you’ve locked down your database cluster using the trusted sources, you would need to make sure that your IP address is actually added there in order to be able to connect.
The line you’re referring to in the
pg_hba.conf
file is used to define client authentication rules for PostgreSQL. You don’t need to worry about it if you are using a managed cluster as this is already pre-configured for you and you don’t have access to change it.As a reference the line
host all all 0.0.0.0/0 md5
means:host
: The connection type, which is a TCP/IP connection in this case.all
: The database(s) this rule applies to. In this case, it applies to all databases.all
: The user(s) this rule applies to. In this case, it applies to all users.0.0.0.0/0
: The IP address(es) this rule applies to. In this case, it applies to all IP addresses.md5
: The authentication method to use. In this case, it’s MD5 password encryption.Let me know how it goes!
Best,
Bobby