one fixing use with libressl (simplified by upstream from a diff written by Kapetanakis Giannis). ok aja@ pea@