For more information about establishing secure software practices and the principles underlying SSL, TLS, and all things concerning network security, I recommend Cybersecurity – Attack and Defense Strategies, Yuri Diogenes, Dr. Erdal Ozkaya, Packt Publishing. It's an illuminating guide to the daily considerations of the engineers who design secure protocols like TLS. It's available through Packt Publishing, here: https://www.packtpub.com/networking-and-servers/cybersecurity-attack-and-defense-strategies.
To understand just how much risk you assume whenever you expose your software to an open network, I'd also recommend Network Vulnerability Assessment, Sagar Rahalkar, Packt Publishing. It approaches the problem more from the perspective of a DevOps engineer or systems engineer than that of a software engineer, but I think it's important...