user15013: I currently try to sign a tx using OpenSSL. After some tinkering I think I got most of the tx right but Electrum complains with mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high) which is probably because of BIP62.
Is there a way to create proper signatures with OpenSSL except trying and hoping to get a small s value?
The rest of my code is in Golang and I couldn't find a proper packages for the used ECDSA curve and so wrapped around OpenSSL.

user51948: Open SSL won't force it, you will have to do it yourself. From BIP 62:

The value S in signatures must be between 0x1 and 0x7FFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 5D576E73 57A4501D DFE92F46 681B20A0 (inclusive). If S is too high, simply replace it by S' = 0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141 - S.

Source

user208: Alternatively, you could use libsecp256k1. This is the code used by Bitcoin Core for signing, and will automatically create low-S signatures (disclaimer: I'm the main author of that library).
Perhaps a Go wrapper exists.
If you stick to OpenSSL, it is possible to manually adjust the S value after signing. This is what Bitcoin Core used to do before v0.10. Here is what it used to do: https://github.com/bitcoin/bitcoin/blob/v0.9.0/src/key.cpp#L204L224

15013: <p>I currently try to sign a tx using OpenSSL. After some tinkering I think I got most of the tx right but Electrum complains with <code>mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high)</code> which is probably because of <a href="https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#low-s-values-in-signatures" rel="nofollow noreferrer">BIP62</a>.</p>

<p>Is there a way to create proper signatures with OpenSSL except trying and hoping to get a small <code>s</code> value?</p>

<p>The rest of my code is in Golang and I couldn't find a proper packages for the used ECDSA curve and so wrapped around OpenSSL.</p>
 51948: <p>Open SSL won't force it, you will have to do it yourself. From BIP 62:</p>

<blockquote>
  <p>The value S in signatures must be between 0x1 and 0x7FFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 5D576E73 57A4501D DFE92F46 681B20A0 (inclusive). If S is too high, simply replace it by S' = 0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141 - S.</p>
</blockquote>

<p><a href="https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#Low_S_values_in_signatures" rel="nofollow noreferrer">Source</a></p>
 208: <p>Alternatively, you could use <a href="https://github.com/bitcoin-core/secp256k1/" rel="nofollow noreferrer">libsecp256k1</a>. This is the code used by Bitcoin Core for signing, and will automatically create low-S signatures (disclaimer: I'm the main author of that library).
Perhaps a Go wrapper exists.</p>

<p>If you stick to OpenSSL, it is possible to manually adjust the S value after signing. This is what Bitcoin Core used to do before v0.10. Here is what it used to do: <a href="https://github.com/bitcoin/bitcoin/blob/v0.9.0/src/key.cpp#L204L224" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/v0.9.0/src/key.cpp#L204L224</a></p>
