Prem Vikash Upadhyay wrote:
Is there any configuration that can be used, to change the 'connection reset by peer' to 'connection refused'?.
With BSD sockets "connection refused" means that no service was listening on this port. It is not an error that can be sent to a connection that was already accepted. The only way to deal with it for stunnel (i.e. without any kernel support or using TLI) would be to unbind the port. https://en.wikipedia.org/wiki/Transport_Layer_Interface
Mike