Follow these step to Create secure TCP/IP Connection with SSL
1. openssl req -new -text -out server.req
Generating a 1024 bit RSA private key
writing new private key to 'privkey.pem'
Enter PEM pass phrase:1234567890
Verifying - Enter PEM pass phrase:1234567890
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [GB]:IN
State or Province Name (full name) [Berkshire]:Karnataka
Locality Name (eg, city) [Newbury]:Bangalore
Organization Name (eg, company) [My Company Ltd]:Center for development of advanced computing
Organizational Unit Name (eg, section) :SENG
Common Name (eg, your name or your server's hostname) :NKN
Email Address :email@example.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password :welcome123#
An optional company name :National Center for Software Technology
2.openssl rsa -in privkey.pem -out server.key
Enter pass phrase for privkey.pem:1234567890
writing RSA key
4.openssl req -x509 -in server.req -text -key server.key -out server.crt
5.chmod og-rwx server.key