# Cannot compile ssl\_verify\_fun in Windows 11 for Elixir

**URL:** <https://forum.devtalk.com/t/cannot-compile-ssl-verify-fun-in-windows-11-for-elixir/118082>\
**Category:** Backend Questions/Help\
**Tags:** elixir, phoenix\
**Created:** [27 July 2023 11:05 UTC](https://forum.devtalk.com/t/cannot-compile-ssl-verify-fun-in-windows-11-for-elixir/118082 "2023-07-27T11:05:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fl4m3Ph03n1x](https://forum.devtalk.com/user_avatar/forum.devtalk.com/fl4m3ph03n1x/32/3808_2.png) [@Fl4m3Ph03n1x](https://forum.devtalk.com/u/Fl4m3Ph03n1x)\
**Post date:** [27 July 2023 11:05 UTC](https://forum.devtalk.com/t/cannot-compile-ssl-verify-fun-in-windows-11-for-elixir/118082/1 "2023-07-27T11:05:47Z")

</div>

## Background

I have a phoenix application in Windows 11. Unfortunately for me, I cannot compile the application because of a dependency error in Windows.

## What I tried

First I tried the downloading Erlang from the official website ([Downloads - Erlang/OTP](https://www.erlang.org/downloads)), and Elixir  
1.15.4 for OTP 26 ([Installing Elixir - The Elixir programming language](https://elixir-lang.org/install.html#windows))

Unfortunately for me, I was greeted with an error when running `mix phx.server`.

```auto
$ mix deps.compile ssl_verify_fun
==> ssl_verify_fun
Compiling 7 files (.erl)
src/ssl_verify_hostname.erl:16: can't find include lib "public_key/include/public_key.hrl"

```

So, this lead me into this Elixir thread where the same issue happens for Ubuntu:

> **[Ubuntu 20.04 compile ssl\_verify\_fun fails](https://elixirforum.com/t/ubuntu-20-04-compile-ssl-verify-fun-fails/32802)**
>
> I have some code that I have been building on Ubuntu 18.04, but decided to switch to Ubuntu 20.04. I encountered an issue though. First, this is Elixir 1.10.3 that comes in Ubuntu’s repository $ elixir --version Erlang/OTP 23 \[erts-11.0.2\]...

The solution found was for the user to install a special erlang package for Ubuntu, `erlang-dev`. However, since I am on Windows, I don’t really have that option.

So I removed both Erlang and Elixir and installed them using scoop, hoping the older versions of both Elixir and Erlang available there would be free of this issue.

With scoop I am now using:

```auto
elixir 1.15.4 main 2023-07-27 10:27:04
erlang 25.3.2.4 main 2023-07-27 10:10:31

```

## Error

However, this still does not fix the issue, as I am greeted with a barrage of errors:

```auto
==> ssl_verify_fun
Compiling 7 files (.erl)
src/ssl_verify_fingerprint.erl:15:14: can't find include lib "public_key/include/public_key.hrl"
% 15| -include_lib("public_key/include/public_key.hrl").
% | ^

src/ssl_verify_pk.erl:14:14: can't find include lib "public_key/include/public_key.hrl"
% 14| -include_lib("public_key/include/public_key.hrl").
% | ^

src/ssl_verify_fun_cert_helpers.erl:13:14: can't find include lib "public_key/include/public_key.hrl"
% 13| -include_lib("public_key/include/public_key.hrl").
% | ^

src/ssl_verify_fingerprint.erl:27:26: record 'OTPCertificate' undefined
% 27| -spec verify_fun(Cert :: #'OTPCertificate'{},
% | ^

src/ssl_verify_pk.erl:26:26: record 'OTPCertificate' undefined
% 26| -spec verify_fun(Cert :: #'OTPCertificate'{},
% | ^

src/ssl_verify_fun_cert_helpers.erl:23:34: undefined macro 'id-ce-subjectAltName'
% 23| AltSubject = select_extension(?'id-ce-subjectAltName', Extensions),
% | ^

src/ssl_verify_fingerprint.erl:29:39: record 'Extension' undefined
% 29| {extension, #'Extension'{}}, InitialUserState :: term()) ->
% | ^

src/ssl_verify_pk.erl:28:39: record 'Extension' undefined
% 28| {extension, #'Extension'{}}, InitialUserState :: term()) ->
% | ^

src/ssl_verify_hostname.erl:16:14: can't find include lib "public_key/include/public_key.hrl"
% 16| -include_lib("public_key/include/public_key.hrl").
% | ^

src/ssl_verify_fun_cert_helpers.erl:9:2: function extract_dns_names/1 undefined
% 9| -export([extract_dns_names/1,
% | ^

src/ssl_verify_fingerprint.erl:52:39: record 'OTPCertificate' undefined
% 52| -spec verify_cert_fingerprint(Cert :: #'OTPCertificate'{}, Fingerprint :: fingerprint()) ->
% | ^

src/ssl_verify_pk.erl:51:30: record 'OTPCertificate' undefined
% 51| -spec verify_cert_pk(Cert :: #'OTPCertificate'{}, Pk :: pk()) ->
% | ^

src/ssl_verify_hostname.erl:28:26: record 'OTPCertificate' undefined
% 28| -spec verify_fun(Cert :: #'OTPCertificate'{},
% | ^

src/ssl_verify_fun_cert_helpers.erl:19:2: spec for undefined function extract_dns_names/1
% 19| -spec extract_dns_names(Cert :: #'OTPCertificate'{}) -> [] | [string()].
% | ^

src/ssl_verify_hostname.erl:30:39: record 'Extension' undefined
% 30| {extension, #'Extension'{}}, InitialUserState :: term()) ->
% | ^

src/ssl_verify_fun_cert_helpers.erl:19:33: record 'OTPCertificate' undefined
% 19| -spec extract_dns_names(Cert :: #'OTPCertificate'{}) -> [] | [string()].
% | ^

src/ssl_verify_hostname.erl:46:36: record 'OTPCertificate' undefined
% 46| -spec verify_cert_hostname(Cert :: #'OTPCertificate'{}, Hostname :: hostname()) ->
% | ^

src/ssl_verify_fun_cert_helpers.erl:32:26: record 'OTPCertificate' undefined
% 32| -spec extract_cn(Cert :: #'OTPCertificate'{}) -> {error, no_common_name} | {ok, string()} | {error, invalid}.
% | ^

src/ssl_verify_hostname.erl:76:38: record 'OTPCertificate' undefined
% 76| Cert :: #'OTPCertificate'{},
% | ^

src/ssl_verify_fun_cert_helpers.erl:34:17: record 'OTPCertificate' undefined
% 34| TBSCert = Cert#'OTPCertificate'.tbsCertificate,
% | ^

src/ssl_verify_fun_cert_helpers.erl:35:32: record 'OTPTBSCertificate' undefined
% 35| {rdnSequence, List} = TBSCert#'OTPTBSCertificate'.subject,
% | ^

src/ssl_verify_fun_cert_helpers.erl:38:26: record 'OTPCertificate' undefined
% 38| -spec extract_pk(Cert :: #'OTPCertificate'{}) -> {error, no_common_name} | #'SubjectPublicKeyInfo'{}.
% | ^

src/ssl_verify_fun_cert_helpers.erl:38:76: record 'SubjectPublicKeyInfo' undefined
% 38| -spec extract_pk(Cert :: #'OTPCertificate'{}) -> {error, no_common_name} | #'SubjectPublicKeyInfo'{}.
% | ^

src/ssl_verify_fun_cert_helpers.erl:40:17: record 'OTPCertificate' undefined
% 40| TBSCert = Cert#'OTPCertificate'.tbsCertificate,
% | ^

src/ssl_verify_fun_cert_helpers.erl:41:26: record 'OTPTBSCertificate' undefined
% 41| PublicKeyInfo = TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo,
% | ^

src/ssl_verify_fun_cert_helpers.erl:42:16: record 'OTPSubjectPublicKeyInfo' undefined
% 42| PublicKeyInfo#'OTPSubjectPublicKeyInfo'.subjectPublicKey.
% | ^

src/ssl_verify_fun_cert_helpers.erl:48:24: record 'Extension' undefined
% 48| -spec extensions_list([#'Extension'{}] | asn1_NOVALUE) -> [] | [#'Extension'{}].
ean it with "mix deps.clean ssl_verify_fun"n, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ssl_verify_fun --force", update it with "mix deps.update ssl_verify_fun" or cl% | ^
src/ssl_verify_fun_cert_helpers.erl:48:65: record 'Extension' undefined
% 48| -spec extensions_list([#'Extension'{}] | asn1_NOVALUE) -> [] | [#'Extension'{}].
% | ^

src/ssl_verify_fun_cert_helpers.erl:55:39: record 'Extension' undefined
% 55| -spec select_extension(Id :: term(), [#'Extension'{}]) -> undefined | #'Extension'{}.
% | ^

src/ssl_verify_fun_cert_helpers.erl:55:71: record 'Extension' undefined
% 55| -spec select_extension(Id :: term(), [#'Extension'{}]) -> undefined | #'Extension'{}.
% | ^

src/ssl_verify_fun_cert_helpers.erl:57:28: record 'Extension' undefined
% 57| Matching = [Extension || #'Extension'{extnID = ExtId} = Extension <- Extensions, ExtId =:= Id],
% | ^

src/ssl_verify_fun_cert_helpers.erl:57:84: variable 'ExtId' is unbound
% 57| Matching = [Extension || #'Extension'{extnID = ExtId} = Extension <- Extensions, ExtId =:= Id],
% | ^

src/ssl_verify_fun_cert_helpers.erl:75:15: record 'AttributeTypeAndValue' undefined
% 75| extract_cn2([[#'AttributeTypeAndValue'{type={2, 5, 4, 3},
% | ^

src/ssl_verify_fun_cert_helpers.erl:77:39: variable 'CN' is unbound
% 77| ssl_verify_fun_encodings:get_string(CN);
% | ^

src/ssl_verify_fun_cert_helpers.erl:49:1: Warning: function extensions_list/1 is unused
% 49| extensions_list(E) ->
% | ^

src/ssl_verify_fun_cert_helpers.erl:56:1: Warning: function select_extension/2 is unused
% 56| select_extension(Id, Extensions) ->
% | ^

src/ssl_verify_fun_cert_helpers.erl:64:1: Warning: function extract_dns_names_from_alt_names/2 is unused
% 64| extract_dns_names_from_alt_names([ExtValue | Rest], Acc) ->
% | ^

```

At this point, given my setup is on Windows, I don’t know what else to try.

## Question

How can I fix this issue?

---

<div class="post-metadata">

**Author:** ![Fl4m3Ph03n1x](https://forum.devtalk.com/user_avatar/forum.devtalk.com/fl4m3ph03n1x/32/3808_2.png) [@Fl4m3Ph03n1x](https://forum.devtalk.com/u/Fl4m3Ph03n1x)\
**Post date:** [3 August 2023 11:14 UTC](https://forum.devtalk.com/t/cannot-compile-ssl-verify-fun-in-windows-11-for-elixir/118082/2 "2023-08-03T11:14:45Z")

</div>

## Answer

After some more digging I found out this issue:

> <https://github.com/elixir-lang/elixir/issues/12653>
>
> \### Elixir and Erlang/OTP versions
> 
> Erlang/OTP 25 \[erts-13.2\] \[source\] \[64-bit\] …\[smp:10:10\] \[ds:10:10:10\] \[async-threads:1\] \[jit\]
> 
> Elixir 1.15.0-rc.2 (9a9cf41) (compiled with Erlang/OTP 25)
> 
> \### Operating system
> 
> macOS Ventura 13.4
> 
> \### Current behavior
> 
> When compiling a project with \`ssl\_verify\_fun\` as a dependency, running \`mix deps.compile\` fails when using Elixir 1.15.0-rc.2.
> 
> \`\`\`
> \> mix deps.compile ssl\_verify\_fun --force
> 
> ==\> ssl\_verify\_fun
> Compiling 7 files (.erl)
> src/ssl\_verify\_hostname.erl:16:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 16| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_pk.erl:14:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 14| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_fingerprint.erl:15:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 15| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:13:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 13| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_hostname.erl:28:26: record 'OTPCertificate' undefined
> % 28| -spec verify\_fun(Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_pk.erl:26:26: record 'OTPCertificate' undefined
> % 26| -spec verify\_fun(Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_fingerprint.erl:27:26: record 'OTPCertificate' undefined
> % 27| -spec verify\_fun(Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:23:34: undefined macro 'id-ce-subjectAltName'
> % 23| AltSubject = select\_extension(?'id-ce-subjectAltName', Extensions),
> % | ^
> 
> src/ssl\_verify\_hostname.erl:30:39: record 'Extension' undefined
> % 30| {extension, #'Extension'{}}, InitialUserState :: term()) -\>
> % | ^
> 
> src/ssl\_verify\_pk.erl:28:39: record 'Extension' undefined
> % 28| {extension, #'Extension'{}}, InitialUserState :: term()) -\>
> % | ^
> 
> src/ssl\_verify\_fingerprint.erl:29:39: record 'Extension' undefined
> % 29| {extension, #'Extension'{}}, InitialUserState :: term()) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:9:2: function extract\_dns\_names/1 undefined
> % 9| -export(\[extract\_dns\_names/1,
> % | ^
> 
> src/ssl\_verify\_hostname.erl:46:36: record 'OTPCertificate' undefined
> % 46| -spec verify\_cert\_hostname(Cert :: #'OTPCertificate'{}, Hostname :: hostname()) -\>
> % | ^
> 
> src/ssl\_verify\_pk.erl:51:30: record 'OTPCertificate' undefined
> % 51| -spec verify\_cert\_pk(Cert :: #'OTPCertificate'{}, Pk :: pk()) -\>
> % | ^
> 
> src/ssl\_verify\_fingerprint.erl:52:39: record 'OTPCertificate' undefined
> % 52| -spec verify\_cert\_fingerprint(Cert :: #'OTPCertificate'{}, Fingerprint :: fingerprint()) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:19:2: spec for undefined function extract\_dns\_names/1
> % 19| -spec extract\_dns\_names(Cert :: #'OTPCertificate'{}) -\> \[\] | \[string()\].
> % | ^
> 
> src/ssl\_verify\_hostname.erl:76:38: record 'OTPCertificate' undefined
> % 76| Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:19:33: record 'OTPCertificate' undefined
> % 19| -spec extract\_dns\_names(Cert :: #'OTPCertificate'{}) -\> \[\] | \[string()\].
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:32:26: record 'OTPCertificate' undefined
> % 32| -spec extract\_cn(Cert :: #'OTPCertificate'{}) -\> {error, no\_common\_name} | {ok, string()} | {error, invalid}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:34:17: record 'OTPCertificate' undefined
> % 34| TBSCert = Cert#'OTPCertificate'.tbsCertificate,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:35:32: record 'OTPTBSCertificate' undefined
> % 35| {rdnSequence, List} = TBSCert#'OTPTBSCertificate'.subject,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:38:26: record 'OTPCertificate' undefined
> % 38| -spec extract\_pk(Cert :: #'OTPCertificate'{}) -\> {error, no\_common\_name} | #'SubjectPublicKeyInfo'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:38:76: record 'SubjectPublicKeyInfo' undefined
> % 38| -spec extract\_pk(Cert :: #'OTPCertificate'{}) -\> {error, no\_common\_name} | #'SubjectPublicKeyInfo'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:40:17: record 'OTPCertificate' undefined
> % 40| TBSCert = Cert#'OTPCertificate'.tbsCertificate,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:41:26: record 'OTPTBSCertificate' undefined
> % 41| PublicKeyInfo = TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:42:16: record 'OTPSubjectPublicKeyInfo' undefined
> % 42| PublicKeyInfo#'OTPSubjectPublicKeyInfo'.subjectPublicKey.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:48:24: record 'Extension' undefined
> % 48| -spec extensions\_list(\[#'Extension'{}\] | asn1\_NOVALUE) -\> \[\] | \[#'Extension'{}\].
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:48:65: record 'Extension' undefined
> % 48| -spec extensions\_list(\[#'Extension'{}\] | asn1\_NOVALUE) -\> \[\] | \[#'Extension'{}\].
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:55:39: record 'Extension' undefined
> % 55| -spec select\_extension(Id :: term(), \[#'Extension'{}\]) -\> undefined | #'Extension'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:55:71: record 'Extension' undefined
> % 55| -spec select\_extension(Id :: term(), \[#'Extension'{}\]) -\> undefined | #'Extension'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:57:28: record 'Extension' undefined
> % 57| Matching = \[Extension || #'Extension'{extnID = ExtId} = Extension \<- Extensions, ExtId =:= Id\],
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:57:84: variable 'ExtId' is unbound
> % 57| Matching = \[Extension || #'Extension'{extnID = ExtId} = Extension \<- Extensions, ExtId =:= Id\],
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:75:15: record 'AttributeTypeAndValue' undefined
> % 75| extract\_cn2(\[\[#'AttributeTypeAndValue'{type={2, 5, 4, 3},
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:77:39: variable 'CN' is unbound
> % 77| ssl\_verify\_fun\_encodings:get\_string(CN);
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:49:1: Warning: function extensions\_list/1 is unused
> % 49| extensions\_list(E) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:56:1: Warning: function select\_extension/2 is unused
> % 56| select\_extension(Id, Extensions) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:64:1: Warning: function extract\_dns\_names\_from\_alt\_names/2 is unused
> % 64| extract\_dns\_names\_from\_alt\_names(\[ExtValue | Rest\], Acc) -\>
> % | ^
> 
> \`\`\`
> 
> 
> \### Expected behavior
> 
> \`ssl\_verify\_fun\` should compile like it does in other Elixir versions.

Which represents my problem. Basically Elixir does not check the correct paths for the missing file:

> <https://github.com/elixir-lang/elixir/issues/12681>
>
> \### Elixir and Erlang/OTP versions
> 
> \`\`\`
> Erlang/OTP 26 \[erts-14.0\] \[source\] \[64-…bit\] \[smp:10:10\] \[ds:10:10:10\] \[async-threads:1\] \[jit\]
> 
> Elixir 1.15.0 (compiled with Erlang/OTP 26)
> \`\`\`
> 
> \### Operating system
> 
> macOS 13.4
> 
> \### Current behavior
> 
> \`public\_key/include/public\_key.hrl\` header cannot be found.
> 
> To reproduce:
> \`\`\`
> git clone https://github.com/deadtrickster/ssl\_verify\_fun.erl.git && cd ssl\_verify\_fun.erl && mix compile
> \`\`\`
> 
> Output:
> \`\`\`erlang
> Compiling 7 files (.erl)
> src/ssl\_verify\_fingerprint.erl:15:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 15| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_fingerprint.erl:27:26: record 'OTPCertificate' undefined
> % 27| -spec verify\_fun(Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_hostname.erl:16:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 16| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_fingerprint.erl:29:39: record 'Extension' undefined
> % 29| {extension, #'Extension'{}}, InitialUserState :: term()) -\>
> % | ^
> 
> src/ssl\_verify\_hostname.erl:28:26: record 'OTPCertificate' undefined
> % 28| -spec verify\_fun(Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_fingerprint.erl:44:39: record 'OTPCertificate' undefined
> % 44| -spec verify\_cert\_fingerprint(Cert :: #'OTPCertificate'{}, Fingerprint :: fingerprint()) -\>
> % | ^
> 
> src/ssl\_verify\_hostname.erl:30:39: record 'Extension' undefined
> % 30| {extension, #'Extension'{}}, InitialUserState :: term()) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:13:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 13| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_pk.erl:14:14: can't find include lib "public\_key/include/public\_key.hrl"
> % 14| -include\_lib("public\_key/include/public\_key.hrl").
> % | ^
> 
> src/ssl\_verify\_hostname.erl:46:36: record 'OTPCertificate' undefined
> % 46| -spec verify\_cert\_hostname(Cert :: #'OTPCertificate'{}, Hostname :: hostname()) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:23:34: undefined macro 'id-ce-subjectAltName'
> % 23| AltSubject = select\_extension(?'id-ce-subjectAltName', Extensions),
> % | ^
> 
> src/ssl\_verify\_pk.erl:26:26: record 'OTPCertificate' undefined
> % 26| -spec verify\_fun(Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_hostname.erl:76:38: record 'OTPCertificate' undefined
> % 76| Cert :: #'OTPCertificate'{},
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:9:2: function extract\_dns\_names/1 undefined
> % 9| -export(\[extract\_dns\_names/1,
> % | ^
> 
> src/ssl\_verify\_pk.erl:28:39: record 'Extension' undefined
> % 28| {extension, #'Extension'{}}, InitialUserState :: term()) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:19:2: spec for undefined function extract\_dns\_names/1
> % 19| -spec extract\_dns\_names(Cert :: #'OTPCertificate'{}) -\> \[\] | \[string()\].
> % | ^
> 
> src/ssl\_verify\_pk.erl:51:30: record 'OTPCertificate' undefined
> % 51| -spec verify\_cert\_pk(Cert :: #'OTPCertificate'{}, Pk :: pk()) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:19:33: record 'OTPCertificate' undefined
> % 19| -spec extract\_dns\_names(Cert :: #'OTPCertificate'{}) -\> \[\] | \[string()\].
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:32:26: record 'OTPCertificate' undefined
> % 32| -spec extract\_cn(Cert :: #'OTPCertificate'{}) -\> {error, no\_common\_name} | {ok, string()} | {error, invalid}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:34:17: record 'OTPCertificate' undefined
> % 34| TBSCert = Cert#'OTPCertificate'.tbsCertificate,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:35:32: record 'OTPTBSCertificate' undefined
> % 35| {rdnSequence, List} = TBSCert#'OTPTBSCertificate'.subject,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:38:26: record 'OTPCertificate' undefined
> % 38| -spec extract\_pk(Cert :: #'OTPCertificate'{}) -\> {error, no\_common\_name} | #'SubjectPublicKeyInfo'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:38:76: record 'SubjectPublicKeyInfo' undefined
> % 38| -spec extract\_pk(Cert :: #'OTPCertificate'{}) -\> {error, no\_common\_name} | #'SubjectPublicKeyInfo'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:40:17: record 'OTPCertificate' undefined
> % 40| TBSCert = Cert#'OTPCertificate'.tbsCertificate,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:41:26: record 'OTPTBSCertificate' undefined
> % 41| PublicKeyInfo = TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo,
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:42:16: record 'OTPSubjectPublicKeyInfo' undefined
> % 42| PublicKeyInfo#'OTPSubjectPublicKeyInfo'.subjectPublicKey.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:48:24: record 'Extension' undefined
> % 48| -spec extensions\_list(\[#'Extension'{}\] | asn1\_NOVALUE) -\> \[\] | \[#'Extension'{}\].
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:48:65: record 'Extension' undefined
> % 48| -spec extensions\_list(\[#'Extension'{}\] | asn1\_NOVALUE) -\> \[\] | \[#'Extension'{}\].
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:55:39: record 'Extension' undefined
> % 55| -spec select\_extension(Id :: term(), \[#'Extension'{}\]) -\> undefined | #'Extension'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:55:71: record 'Extension' undefined
> % 55| -spec select\_extension(Id :: term(), \[#'Extension'{}\]) -\> undefined | #'Extension'{}.
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:57:28: record 'Extension' undefined
> % 57| Matching = \[Extension || #'Extension'{extnID = ExtId} = Extension \<- Extensions, ExtId =:= Id\],
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:57:84: variable 'ExtId' is unbound
> % 57| Matching = \[Extension || #'Extension'{extnID = ExtId} = Extension \<- Extensions, ExtId =:= Id\],
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:75:15: record 'AttributeTypeAndValue' undefined
> % 75| extract\_cn2(\[\[#'AttributeTypeAndValue'{type={2, 5, 4, 3},
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:77:39: variable 'CN' is unbound
> % 77| ssl\_verify\_fun\_encodings:get\_string(CN);
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:49:1: Warning: function extensions\_list/1 is unused
> % 49| extensions\_list(E) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:56:1: Warning: function select\_extension/2 is unused
> % 56| select\_extension(Id, Extensions) -\>
> % | ^
> 
> src/ssl\_verify\_fun\_cert\_helpers.erl:64:1: Warning: function extract\_dns\_names\_from\_alt\_names/2 is unused
> % 64| extract\_dns\_names\_from\_alt\_names(\[ExtValue | Rest\], Acc) -\>
> % | ^
> \`\`\`
> 
> \### Expected behavior
> 
> Compiles as expected with Elixir \`1.14.5\`.
> 
> Output:
> \`\`\`erlang
> Compiling 7 files (.erl)
> Generated ssl\_verify\_fun app
> \`\`\`

Now, there is a possible workaround for this issue. By forcing your application to use a more updated version of the dependency in question (`ssl_verify_fun`), you can add this to your `mix.exs` file:

> {:ssl\_verify\_fun, “~\> 1.1.7”, manager: :rebar3, override: true}

However, I don’t really like this. If tomorrow the same thing happens, you have to overwrite again. And when overwrites start conflicting with each other, then you really have a problem.

In my case, I found which application was using the old version of `ssl_verify_fun` by looking at `mix.lock`. It was `hackney`.

However, instead of going through every dependency and trying to fix it, I took the more nuclear approach. I deleted my `mix.lock` and then run `mix deps.update --all`.

This forced some older dependencies to update. After that a simple `mix deps.get` fixed the issue and `mix phx.server` worked.

You can find more information in the Elixir Forum thread:

> **[Cannot compile ssl\_verify\_fun in Windows 11](https://elixirforum.com/t/cannot-compile-ssl-verify-fun-in-windows-11/57265/4)**
>
> I develop in Windows because my application is for Windows users. I literally have no other choice if I want to use Elixir. Besides, given my investigation, I have reason to believe this is not a Windows specific issue, even though I admit I have...

---

<div class="post-metadata">

**Author:** ![kokolegorille](https://forum.devtalk.com/user_avatar/forum.devtalk.com/kokolegorille/32/575_2.png) [@kokolegorille](https://forum.devtalk.com/u/kokolegorille)\
**Post date:** [3 August 2023 23:03 UTC](https://forum.devtalk.com/t/cannot-compile-ssl-verify-fun-in-windows-11-for-elixir/118082/3 "2023-08-03T23:03:07Z")

</div>

Sometime removing mix.lock and \_build, deps folders is helping in dev.

But it might not be recommended otherwise 🙂

Glad You find a solution to your problem.
