question

Nicolas Colombe avatar image
Nicolas Colombe asked

Linux game server curl error 77 when trying to log in PlayFab

I have been following this guide to setup a Linux build of my game server, and when I try to run it, I get an error 77 with curl when trying to login in PlayFab with the title secret key.

It only happens when executing it from inside the container, it works in Windows, and it work in WSL.

Here is my docker file :

FROM ubuntu:22.04

RUN apt-get update
RUN apt-get install -y libssl1.1

WORKDIR /assets
COPY project /assets

WORKDIR /app
COPY linux/<Server executable> .
COPY settings/PlayFabSecret .
RUN chmod +x <Server executable>

CMD [<Server start command>]

and the playfab connection code in the server, which works on Windows and WSL :

std::ifstream secretFile("./PlayFabSecret");
std::string pfKey;
secretFile >> pfKey;

PlayFabSettings::staticSettings->titleId = (<title ID>);
PlayFabSettings::staticSettings->developerSecretKey = pfKey;

//Wrapper around PlayFab APIs to allow synchronous wait
eXl::Err res = m_AuthExecutor.WaitForQuery(&PlayFabAuthenticationInstanceAPI::GetEntityToken, AuthenticationModels::GetEntityTokenRequest(), [&]
        (AuthenticationModels::GetEntityTokenResponse const& iResp)
{
	// Result in Windows and WSL
	LOG_INFO << "Playfab login successful";	
	m_AuthExecutor.GetAuthenticationContext()->entityToken = iResp.EntityToken;
});

if (!res)
{
	// Result in the container + curl error 77
	LOG_INFO << "Playfab login failure";
	exit(1);
}

multiplayer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nicolas Colombe avatar image
Nicolas Colombe answered

Thanks.

Turns out installing the libcurl package (which I built myself and statically linked) like in the linked Dockerfile drags the ca-certificates package as a dependency, which was the missing part.

So adding apt-get install ca-certificates fixed it for me.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Made Wang avatar image
Made Wang answered

In fact, Curl Error 77 is not an error returned by PlayFab.

This error seems to be related to the certificate. Have you used an outdated root certificate in the docker container or did not install certificate-related dependencies? It is recommended that you go to Curl or the docker community for professional support.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nicolas Colombe avatar image Nicolas Colombe commented ·

You have my whole Docker file, I have not done anything certificate related.

What would be the certificate to use in order to connect to PlayFab? My guess is that they are installed by default in Windows and WSL.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.