[Newbie] Update built-in Libraries

Hello,
I’m moving from Arduino IDE to PlatformIO in vscode.

I am trying to create a small project using my esp32 and I am stuck with the wifi, WiFiClientSecure libraries. According to the WiFiClientSecure github page, the latest release is version 2. PlatformIO seems to be on v1 still. I need to update to version 2 in order to use the .setAlpnProtocols method which is not in v1.

How do I update the built-in libraries?

Duplicate of ESP32 C++17 toolchain missing std::optional - #7 by maxgerhardt and Using latest ESP32 Arduino, but with own IDF configuration.