How to use included OpenSSL

My problem is that I kept trying to do things in the target file, not the build file - For some reason it just never clicked that I was in the wrong file.

To enable OpenSSL in an unreal c++ project (I’m using Visual Studio):

Open up your project build file.

Add OpenSSL to the PublicDependencyModuleNames:

using UnrealBuildTool;

public class MyProject : ModuleRules
{
    public MyProject(ReadOnlyTargetRules Target) : base(Target)
    {
         PublicDependencyModuleNames.AddRange(new string[] {
        "PhysicsCore",
        "OpenSSL"
        });
    }
}

Close your solution, right click your unreal project .uproject file and choose “Generate Project Files”.

Where you want to use openSSL add at the top of your code file in the includes section or in your header file. (in my case I’m using evp as the docs say for sha256).

#define UI UI_ST
THIRD_PARTY_INCLUDES_START
#include "openssl/evp.h"
THIRD_PARTY_INCLUDES_END
#undef UI
3 Likes