add paramter validation to SSL I/O calls