diff --git a/libctru/include/3ds/services/httpc.h b/libctru/include/3ds/services/httpc.h index 481c8c315..5ffccc399 100644 --- a/libctru/include/3ds/services/httpc.h +++ b/libctru/include/3ds/services/httpc.h @@ -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 @@ -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); - diff --git a/libctru/source/services/httpc.c b/libctru/source/services/httpc.c index fd7f38e1e..3eb85fb67 100644 --- a/libctru/source/services/httpc.c +++ b/libctru/source/services/httpc.c @@ -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();