Skip to content

Commit ffe5cb5

Browse files
committed
setCACert()
1 parent fba2c98 commit ffe5cb5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AudioTools/CoreAudio/AudioHttp/URLStreamESP32.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ class URLStreamESP32 : public AbstractURLStream {
266266
}
267267
/// provides access to the HttpRequest
268268
virtual HttpRequest& httpRequest() { return request; }
269+
269270
/// Writes are not supported
270271
int availableForWrite() override { return 1024; }
271272

@@ -299,12 +300,15 @@ class URLStreamESP32 : public AbstractURLStream {
299300
request.header().put(header, value);
300301
}
301302

303+
/// Defines the read buffer size
302304
void setBufferSize(int size) { buffer_size = size; }
303305

304306
/// Define the Root PEM Certificate for SSL
305307
void setCACert(const uint8_t* cert, int len) {
306308
pem_cert_len = len;
307309
pem_cert = cert;
310+
// certificate must end with traling null
311+
assert(cert[len-1]==0);
308312
}
309313

310314
/// Method compatible with Arduino WiFiClientSecure API

0 commit comments

Comments
 (0)