Imported from http://tls.sourceforge.net