Due to name collision in nossl_connect, i had to change the name of int socket -> int sock. Alternately I tried changing the socket constructor to lwip_socket( xxx,xxx,xxx) which also worked.