Client server model with multiple clients and one server and file transfer between them
STEPS:
- Run the SERVER program
- Run the CLIENT program in another terminal on the same system/or different system(if appropiate certificates generated and added to user certificates)
- The clients entering the server specify if they are existing users(type existing) or new users(type new) and provider appropiate user name and password for the same
- the login/signup is crosschecked by the server using userinfo.txt file and connection is accepted or rejected appropiately
- Multiple CLIENTS can join the same SERVER and share files to and from server
- Each client has the following options (LIST-to see current server files,STOR-to upload a file to server, GET-to get a file from the server, DELETE- to delete a file from the server, CLOSE- to gracefully exit the connection)
- Mechanism to check if ssl is working or not
- Ensure the existence of "server_files" and "client_files" directory in the same directory as client code and server code in the server and client systems respectively
The program is configured to use a signed certificate and a private key to implement ssl. Generate the necessary certificate and files Ensure the naming of the files before running the program
Steps to generate a self signed certificate
- openssl genrsa -aes256 -out private.key 2048
- openssl rsa -in private.key -out private.key
- openssl req -new -x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500 -addext "subjectAltName=IP:"
- openssl req -x509 -new -nodes -key private.key -sha1 -days 36500 -out signedcert.pem -addext "subjectAltName=IP:"
Choose the desired length of the rsa key you want to generate. 4098 or 2048 or whatever Choose the validity of the certificate. here we do so in days Enter the IPV4 address on which the server is to run Add the certificate.crt file generate onto the Trusted Root Certification Authorities\Certificates directory The server requires the .pem and the .key files both The client requires the .pem file Ensure they are in the same directories as the server and client programs Alternatively modify client ans server programs to reflect the locations of the .key and .pem files
REFERENCES:
-
socket programming in python https://www.datacamp.com/tutorial/a-complete-guide-to-socket-programming-in-python
-
SSL implementation https://www.youtube.com/watch?v=N4utwloVeOE