Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion libctru/include/3ds/services/httpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ Result httpcSetClientCertDefault(httpcContext *context, SSLC_DefaultClientCert c
*/
Result httpcSetClientCertContext(httpcContext *context, u32 ClientCert_contexthandle);

/**
* @brief Gets the last SSL result.
* @param context Context to fetch the result from.
*/
Result httpcGetSSLResult(httpcContext *context, Result *ssl_res);

/**
* @brief Sets SSL options for the context.
* The HTTPC SSL option bits are the same as those defined in sslc.h
Expand Down Expand Up @@ -298,4 +304,3 @@ Result httpcDownloadData(httpcContext *context, u8* buffer, u32 size, u32 *downl
* @param option HTTPC_KeepAlive option.
*/
Result httpcSetKeepAlive(httpcContext *context, HTTPC_KeepAlive option);

13 changes: 13 additions & 0 deletions libctru/source/services/httpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,19 @@ Result httpcSetClientCertContext(httpcContext *context, u32 ClientCert_contextha
return cmdbuf[1];
}

Result httpcGetSSLResult(httpcContext *context, Result *ssl_res)
{
u32* cmdbuf=getThreadCommandBuffer();

cmdbuf[0]=IPC_MakeHeader(0x2A,1,0); // 0x2A0040
cmdbuf[1]=context->httphandle;

Result ret=0;
if(R_FAILED(ret=svcSendSyncRequest(context->servhandle)))return ret;
*ssl_res = cmdbuf[2];
return cmdbuf[1];
}

Result httpcSetSSLOpt(httpcContext *context, u32 options)
{
u32* cmdbuf=getThreadCommandBuffer();
Expand Down