{"id":6452,"date":"2019-06-04T22:41:37","date_gmt":"2019-06-04T20:41:37","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=6452"},"modified":"2024-09-12T08:31:13","modified_gmt":"2024-09-12T06:31:13","slug":"openssl-build-on-windows","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/openssl-build-on-windows\/","title":{"rendered":"OpenSSL: Build on Windows"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_6452 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_6452')){$('.twoclick_social_bookmarks_post_6452').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"OpenSSL%3A%20Build%20on%20Windows\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Athese%20steps%20compile%20openssl%20on%20Windows.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/openssl-build-on-windows\\\/\",\"post_id\":6452,\"post_title_referrer_track\":\"OpenSSL%3A+Build+on+Windows\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>these steps compile openssl on Windows.<br \/>\n<!--more--><br \/>\nInstall the <a href=\"https:\/\/visualstudio.microsoft.com\/de\/vs\/community\/\" rel=\"noopener noreferrer\" target=\"_blank\">Visual Studio Community Edition <\/a>, <a href=\"https:\/\/git-scm.com\/download\/win\" rel=\"noopener noreferrer\" target=\"_blank\">git <\/a>and<a href=\"http:\/\/strawberryperl.com\/\" rel=\"noopener noreferrer\" target=\"_blank\"> Strawberry Perl<\/a>.<\/p>\n<p><strong>nasm<\/strong> is needed for builing openssl. To get it, open Visual Studio and create a New Project &#8220;Console App Tags: C++, Windows, Console&#8221;. Simply store it to D:\\temp and name it TempNASM. When finshed, right click the project and select Manage NuGet Packages. Search for nasm and install the latest version. You can find the executable at &#8220;D:\\Temp\\TempNASM\\packages\\nasm.2.10.07\\tools&#8221;.<\/p>\n<p>To install Strawberry Perl download the latest 64Bit zip edition an extract it, for example, to D:\\perl. Then execute the two batch files <strong>relocation.pl.bat<\/strong> and <strong>update_env.pl.bat<\/strong>. These batches adjust the internal path references and add perl to the search path.<\/p>\n<p>Depending on the Architecture for which you want to build openssl, x64 or x86, open the &#8220;<strong>x64 Native Tools Command Prompt for VS 2019<\/strong>&#8221; or &#8220;<strong>x86 Native Tools Command Prompt for VS 2019<\/strong>&#8221; shell from start menu.<\/p>\n<p>Get the sources from github<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nD:\\&gt; cd \/d D:\\\r\nD:\\&gt; mkdir temp\r\nD:\\&gt; cd temp\r\nD:\\temp&gt; git clone https:\/\/github.com\/openssl\/openssl\r\nD:\\temp&gt; cd openssl\r\n<\/pre>\n<p>This would build the latest development version. If you want to build the latest 1.1.1 stable release<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nD:\\temp\\openssl&gt; git checkout OpenSSL_1_1_1-stable\r\n<\/pre>\n<p>Add nasm to the search path<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nD:\\temp\\openssl&gt; set PATH=%PATH%;D:\\Temp\\TempNASM\\packages\\nasm.2.10.07\\tools;\r\n<\/pre>\n<p>Configure openssl with it default settings(Ciphers,&#8230;) for x64 architecture<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nD:\\temp\\openssl&gt; nmake clean\r\nD:\\temp\\openssl&gt; perl Configure VC-WIN64A\r\n<\/pre>\n<p>The default version string is like &#8220;OpenSSL 1.1.1d-dev  xx XXX xxxx&#8221;. xx XXX xxxx is a placeholder for the Build date. If you want to adjust the version text edit the macro <strong>OPENSSL_VERSION_TEXT <\/strong>in &#8220;<strong>include\\openssl\\opensslv.h<\/strong>&#8220;. For example<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# define OPENSSL_VERSION_TEXT    &quot;OpenSSL 1.1.1d-dev  05 Jun 2019&quot;\r\n<\/pre>\n<p>And compile<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nD:\\temp\\openssl&gt; nmake all\r\n<\/pre>\n<p>You can find <strong>openssl.exe<\/strong> in the <strong>apps <\/strong>folder<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nD:\\temp\\openssl&gt; apps\\openssl.exe version\r\nOpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)\r\n<\/pre>\n<p>Clean up your temporary Visual Studio Project<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nD:&gt; rmdir \/S \/Q D:\\Temp\\TempNASM\r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, these steps compile openssl on Windows.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1036,466],"tags":[337,547,20],"class_list":["post-6452","post","type-post","status-publish","format-standard","hentry","category-openssl","category-security","tag-compile","tag-openssl","tag-windows-2"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=6452"}],"version-history":[{"count":15,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6452\/revisions"}],"predecessor-version":[{"id":6469,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6452\/revisions\/6469"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=6452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=6452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=6452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}