Skip to content

Commit 7f257b6

Browse files
committed
add http:c GetSSLResult
1 parent 0076007 commit 7f257b6

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

libctru/include/3ds/services/httpc.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ Result httpcSetClientCertDefault(httpcContext *context, SSLC_DefaultClientCert c
207207
*/
208208
Result httpcSetClientCertContext(httpcContext *context, u32 ClientCert_contexthandle);
209209

210+
/**
211+
* @brief Gets the last SSL result.
212+
* @param context Context to fetch the result from.
213+
*/
214+
Result httpcGetSSLResult(httpcContext *context, Result *ssl_res);
215+
210216
/**
211217
* @brief Sets SSL options for the context.
212218
* The HTTPC SSL option bits are the same as those defined in sslc.h
@@ -298,4 +304,3 @@ Result httpcDownloadData(httpcContext *context, u8* buffer, u32 size, u32 *downl
298304
* @param option HTTPC_KeepAlive option.
299305
*/
300306
Result httpcSetKeepAlive(httpcContext *context, HTTPC_KeepAlive option);
301-

libctru/source/services/httpc.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,19 @@ Result httpcSetClientCertContext(httpcContext *context, u32 ClientCert_contextha
580580
return cmdbuf[1];
581581
}
582582

583+
Result httpcGetSSLResult(httpcContext *context, Result *ssl_res)
584+
{
585+
u32* cmdbuf=getThreadCommandBuffer();
586+
587+
cmdbuf[0]=IPC_MakeHeader(0x2A,1,0); // 0x2A0040
588+
cmdbuf[1]=context->httphandle;
589+
590+
Result ret=0;
591+
if(R_FAILED(ret=svcSendSyncRequest(context->servhandle)))return ret;
592+
*ssl_res = cmdbuf[2];
593+
return cmdbuf[1];
594+
}
595+
583596
Result httpcSetSSLOpt(httpcContext *context, u32 options)
584597
{
585598
u32* cmdbuf=getThreadCommandBuffer();

0 commit comments

Comments
 (0)