diff --git a/.gitmodules b/.gitmodules
index d36acbfe5..a7f9718ae 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -17,3 +17,7 @@
 [submodule "components/coap/libcoap"]
 	path = components/coap/libcoap
 	url = ../../obgm/libcoap.git
+
+[submodule "components/wolfssl"]
+	path = components/wolfssl
+	url = ../wolfssl.git
diff --git a/components/esp-tls/CMakeLists.txt b/components/esp-tls/CMakeLists.txt
index 199c554ad..1b1b924d2 100644
--- a/components/esp-tls/CMakeLists.txt
+++ b/components/esp-tls/CMakeLists.txt
@@ -12,10 +12,14 @@ endif()
 idf_component_register(SRCS "${srcs}"
                     INCLUDE_DIRS "."
                     PRIV_INCLUDE_DIRS "private_include"
-                    REQUIRES mbedtls
+                    REQUIRES mbedtls wolfssl
                     PRIV_REQUIRES lwip http_parser)
 
 if(CONFIG_ESP_TLS_USING_WOLFSSL)
-    idf_component_get_property(wolfssl esp-wolfssl COMPONENT_LIB)
-    target_link_libraries(${COMPONENT_LIB} PUBLIC ${wolfssl})
+    if(CONFIG_ESP_WOLFSSL_INTERNAL)
+        idf_component_get_property(wolfssl esp-wolfssl COMPONENT_LIB)
+        target_link_libraries(${COMPONENT_LIB} PUBLIC ${wolfssl})
+    elseif(CONFIG_TLS_STACK_WOLFSSL)
+        component_compile_options("-DWOLFSSL_USER_SETTINGS")
+    endif()
 endif()
diff --git a/components/spi_flash/CMakeLists.txt b/components/spi_flash/CMakeLists.txt
index 255eff8e7..287e63c13 100644
--- a/components/spi_flash/CMakeLists.txt
+++ b/components/spi_flash/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(srcs "src/partition"
+set(srcs "src/partition.c"
          "src/spi_flash_raw.c"
          "src/spi_flash.c")
 if(BOOTLOADER_BUILD)
diff --git a/components/wolfssl b/components/wolfssl
new file mode 160000
index 000000000..ec5c7872b
--- /dev/null
+++ b/components/wolfssl
@@ -0,0 +1 @@
+Subproject commit ec5c7872bc1030f9c1c231ec229130c05370434b