I have opened a TCP connection with the database server using:
conn, err := net.Dial("tcp", "localhost:5432")
Which is successful after that I am running this piece of code:
_, err = conn.Write([]byte(query))
if err != nil {
fmt.Printf("Query failed: %v\n", err)
return
// Read the response and print the result in table view
buf := make([]byte, 50000)
n, err := conn.Read(buf)
if err != nil {
fmt.Printf("Failed to read response: %v\n", err)
return
}
fmt.Printf("Response received: %s\n", string(buf[:n]))
It prints: Response received: N
And log file of server says:
2023-02-22 22:59:49.834 PKT [54802] FATAL: received unencrypted data after SSL request
2023-02-22 22:59:49.834 PKT [54802] DETAIL: This could be either a client-software bug or evidence of an attempted man-in-the-middle attack.