<commit_before>---
layout: post
title: "Using the OpenSSL library with macOS"
image: https://www.poweradmin.com/blog/wp-content/uploads/2013/10/openssl-logo2.png
tags: [OpenSSL, OSX]
comments: true
---

Working with C++ libraries on a Mac can be a pain and OpenSSL, a very popular one that’s used in many other libraries, led me scrambling around the web and going through different StackOverflow posts, Github issues, and blog posts/forums trying to figure out a way to do it without reinstalling everything.
Usually, you would just install OpenSSL with Homebrew….

```bash
$ brew install openssl
```

And then link it…

```bash
$ brew link --force openssl
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure, deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
   -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
```

But don’t worry! There’s a fix. Homebrew installs OpenSSL but doesn’t link it to `/usr/local/include`, where the compiler looks into during `#include< …>` Thus, you must manually link it instead:

```bash
$ ln -s ~/.development/homebrew/opt/openssl/include/openssl /usr/local/include
```

You also might want to link:

```bash
$ ln -s ~/.development/homebrew/Cellar/openssl@1.1/[version]/bin/openssl /usr/bin/openssl<commit_msg>add openssl<commit_after>---
layout: post
title: "Using the OpenSSL library with macOS"
image: https://www.poweradmin.com/blog/wp-content/uploads/2013/10/openssl-logo2.png
tags: [OpenSSL, OSX]
comments: true
---

Working with C++ libraries on a Mac can be a pain and OpenSSL, a very popular one that’s used in many other libraries, led me scrambling around the web and going through different StackOverflow posts, Github issues, and blog posts/forums trying to figure out a way to do it without reinstalling everything.
Usually, you would just install OpenSSL with Homebrew….

```bash
$ brew install openssl
```

And then link it…

```bash
$ brew link --force openssl
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure, deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
   -I~/.development/homebrew/opt/openssl/include -L~/.development/homebrew/opt/openssl/lib
```

But don’t worry! There’s a fix. Homebrew installs OpenSSL but doesn’t link it to `/usr/local/include`, where the compiler looks into during `#include< …>` Thus, you must manually link it instead:

```bash
$ ln -s ~/.development/homebrew/opt/openssl/include/openssl /usr/local/include
```

You also might want to link:

```bash
$ ln -s ~/.development/homebrew/Cellar/openssl@1.1/[version]/bin/openssl /usr/bin/openssl
{'fraction_non_alphanumeric': 0.10337552742616034, 'fraction_numerical': 0.006329113924050633, 'mean_word_length': 4.388257575757576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6331611', 'n_tokens_mistral': 901, 'n_tokens_neox': 820, 'n_words': 350}