I tested the above command in docker for many platforms, But it seems that none of them has such issue.
Please correct me if I misunderstood.
The test code:
openssl version
openssl genrsa 2048 2>/dev/null > mykey.key
openssl req -new -sha256 -key mykey.key -subj "/CN=my.com" | openssl asn1parse -inform pem | head -3 | tail -1 | grep "l= 1 prim:"
The test results:
[Sun Sep 18 07:27:18 CEST 2016] Running ubuntu:14.04, this may take a few minutes, please wait.
OpenSSL 1.0.1f 6 Jan 2014
8:d=2 hl=2 l= 1 prim: INTEGER :00
ubuntu:14.04 [PASS]
[Sun Sep 18 07:27:19 CEST 2016] Running ubuntu:15.04, this may take a few minutes, please wait.
OpenSSL 1.0.1f 6 Jan 2014
8:d=2 hl=2 l= 1 prim: INTEGER :00
ubuntu:15.04 [PASS]
[Sun Sep 18 07:27:20 CEST 2016] Running ubuntu:16.04, this may take a few minutes, please wait.
OpenSSL 1.0.2g-fips 1 Mar 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
ubuntu:16.04 [PASS]
[Sun Sep 18 07:27:21 CEST 2016] Running ubuntu:latest, this may take a few minutes, please wait.
OpenSSL 1.0.2g-fips 1 Mar 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
ubuntu:latest [PASS]
[Sun Sep 18 07:27:21 CEST 2016] Running debian:7, this may take a few minutes, please wait.
OpenSSL 1.0.1e 11 Feb 2013
8:d=2 hl=2 l= 1 prim: INTEGER :00
debian:7 [PASS]
[Sun Sep 18 07:27:22 CEST 2016] Running debian:8, this may take a few minutes, please wait.
OpenSSL 1.0.1k 8 Jan 2015
8:d=2 hl=2 l= 1 prim: INTEGER :00
debian:8 [PASS]
[Sun Sep 18 07:27:23 CEST 2016] Running debian:latest, this may take a few minutes, please wait.
OpenSSL 1.0.1k 8 Jan 2015
8:d=2 hl=2 l= 1 prim: INTEGER :00
debian:latest [PASS]
[Sun Sep 18 07:27:23 CEST 2016] Running centos:5, this may take a few minutes, please wait.
OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
8:d=2 hl=2 l= 1 prim: INTEGER :00
centos:5 [PASS]
[Sun Sep 18 07:27:24 CEST 2016] Running centos:6, this may take a few minutes, please wait.
OpenSSL 1.0.1e-fips 11 Feb 2013
8:d=2 hl=2 l= 1 prim: INTEGER :00
centos:6 [PASS]
[Sun Sep 18 07:27:25 CEST 2016] Running centos:7, this may take a few minutes, please wait.
OpenSSL 1.0.1e-fips 11 Feb 2013
8:d=2 hl=2 l= 1 prim: INTEGER :00
centos:7 [PASS]
[Sun Sep 18 07:27:26 CEST 2016] Running centos:latest, this may take a few minutes, please wait.
OpenSSL 1.0.1e-fips 11 Feb 2013
8:d=2 hl=2 l= 1 prim: INTEGER :00
centos:latest [PASS]
[Sun Sep 18 07:27:26 CEST 2016] Running fedora:21, this may take a few minutes, please wait.
OpenSSL 1.0.1k-fips 8 Jan 2015
8:d=2 hl=2 l= 1 prim: INTEGER :00
fedora:21 [PASS]
[Sun Sep 18 07:27:27 CEST 2016] Running fedora:22, this may take a few minutes, please wait.
OpenSSL 1.0.1k-fips 8 Jan 2015
8:d=2 hl=2 l= 1 prim: INTEGER :00
fedora:22 [PASS]
[Sun Sep 18 07:27:28 CEST 2016] Running fedora:23, this may take a few minutes, please wait.
OpenSSL 1.0.2h-fips 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
fedora:23 [PASS]
[Sun Sep 18 07:27:29 CEST 2016] Running fedora:latest, this may take a few minutes, please wait.
OpenSSL 1.0.2h-fips 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
fedora:latest [PASS]
[Sun Sep 18 07:27:29 CEST 2016] Running opensuse:13.2, this may take a few minutes, please wait.
OpenSSL 1.0.1k-fips 8 Jan 2015
8:d=2 hl=2 l= 1 prim: INTEGER :00
opensuse:13.2 [PASS]
[Sun Sep 18 07:27:30 CEST 2016] Running opensuse:42.1, this may take a few minutes, please wait.
OpenSSL 1.0.1i-fips 6 Aug 2014
8:d=2 hl=2 l= 1 prim: INTEGER :00
opensuse:42.1 [PASS]
[Sun Sep 18 07:27:31 CEST 2016] Running opensuse:latest, this may take a few minutes, please wait.
OpenSSL 1.0.1i-fips 6 Aug 2014
8:d=2 hl=2 l= 1 prim: INTEGER :00
opensuse:latest [PASS]
[Sun Sep 18 07:27:32 CEST 2016] Running alpine:3.1, this may take a few minutes, please wait.
OpenSSL 1.0.1t 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
alpine:3.1 [PASS]
[Sun Sep 18 07:27:32 CEST 2016] Running alpine:3.2, this may take a few minutes, please wait.
OpenSSL 1.0.2h 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
alpine:3.2 [PASS]
[Sun Sep 18 07:27:33 CEST 2016] Running alpine:3.3, this may take a few minutes, please wait.
OpenSSL 1.0.2h 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
alpine:3.3 [PASS]
[Sun Sep 18 07:27:34 CEST 2016] Running alpine:latest, this may take a few minutes, please wait.
OpenSSL 1.0.2h 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
alpine:latest [PASS]
[Sun Sep 18 07:27:34 CEST 2016] Running oraclelinux:6, this may take a few minutes, please wait.
OpenSSL 1.0.1e-fips 11 Feb 2013
8:d=2 hl=2 l= 1 prim: INTEGER :00
oraclelinux:6 [PASS]
[Sun Sep 18 07:27:35 CEST 2016] Running oraclelinux:7, this may take a few minutes, please wait.
OpenSSL 1.0.1e-fips 11 Feb 2013
8:d=2 hl=2 l= 1 prim: INTEGER :00
oraclelinux:7 [PASS]
[Sun Sep 18 07:27:36 CEST 2016] Running oraclelinux:latest, this may take a few minutes, please wait.
OpenSSL 1.0.1e-fips 11 Feb 2013
8:d=2 hl=2 l= 1 prim: INTEGER :00
oraclelinux:latest [PASS]
[Sun Sep 18 07:27:37 CEST 2016] Running kalilinux/kali-linux-docker, this may take a few minutes, please wait.
OpenSSL 1.0.2h 3 May 2016 (Library: OpenSSL 1.0.2g 1 Mar 2016)
8:d=2 hl=2 l= 1 prim: INTEGER :00
kalilinux/kali-linux-docker [PASS]
[Sun Sep 18 07:27:37 CEST 2016] Running base/archlinux, this may take a few minutes, please wait.
OpenSSL 1.0.2h 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
base/archlinux [PASS]
[Sun Sep 18 07:27:38 CEST 2016] Running mageia, this may take a few minutes, please wait.
OpenSSL 1.0.2h 3 May 2016
8:d=2 hl=2 l= 1 prim: INTEGER :00
mageia [PASS]