2323 check_secure_default_shotgun_invalid /1 ,
2424 check_secure_default_shotgun_stream_endpoint_federal /1 ,
2525 check_secure_default_httpc_poll_endpoint_federal /1 ,
26- check_secure_default_httpc_events_endpoint_federal /1
26+ check_secure_default_httpc_events_endpoint_federal /1 ,
27+ check_certifi_shotgun_stream_endpoint /1 ,
28+ check_certifi_shotgun_stream_endpoint_federal /1 ,
29+ check_certifi_httpc_poll_endpoint /1 ,
30+ check_certifi_httpc_poll_endpoint_federal /1 ,
31+ check_certifi_httpc_events_endpoint /1 ,
32+ check_certifi_httpc_events_endpoint_federal /1
2733]).
2834
2935% %====================================================================
@@ -44,7 +50,13 @@ all() ->
4450 check_secure_default_shotgun_invalid ,
4551 check_secure_default_shotgun_stream_endpoint_federal ,
4652 check_secure_default_httpc_poll_endpoint_federal ,
47- check_secure_default_httpc_events_endpoint_federal
53+ check_secure_default_httpc_events_endpoint_federal ,
54+ check_certifi_shotgun_stream_endpoint ,
55+ check_certifi_shotgun_stream_endpoint_federal ,
56+ check_certifi_httpc_poll_endpoint ,
57+ check_certifi_httpc_poll_endpoint_federal ,
58+ check_certifi_httpc_events_endpoint ,
59+ check_certifi_httpc_events_endpoint_federal
4860 ].
4961
5062init_per_suite (Config ) ->
@@ -206,3 +218,53 @@ check_secure_default_shotgun_invalid(_) ->
206218 connect_timeout => undefined ,
207219 custom_headers => undefined
208220 }, " LD_SDK_KEY" ).
221+
222+ % % Using certifi
223+
224+ check_certifi_shotgun_stream_endpoint (_ ) ->
225+ {ok , _ } = open_stream (" https://stream.launchdarkly.com/all" , #{
226+ tls_options => ldclient_config :tls_basic_certifi_options (),
227+ connect_timeout => undefined ,
228+ custom_headers => undefined
229+ }, " LD_SDK_KEY" ).
230+
231+ check_certifi_shotgun_stream_endpoint_federal (_ ) ->
232+ {ok , _ } = open_stream (" https://stream.launchdarkly.us/all" , #{
233+ tls_options => ldclient_config :tls_basic_certifi_options (),
234+ connect_timeout => undefined ,
235+ custom_headers => undefined
236+ }, " LD_FED_SDK_KEY" ).
237+
238+ check_certifi_httpc_poll_endpoint (_ ) ->
239+ Options = [{ssl , ldclient_config :tls_basic_certifi_options ()}],
240+ {ok , _ } = httpc :request (get , {" https://sdk.launchdarkly.com/sdk/latest-all" , [
241+ {" Authorization" , os :getenv (" LD_SDK_KEY" )},
242+ {" User-Agent" , ldclient_config :get_user_agent ()}
243+ ]}, Options , []).
244+
245+ check_certifi_httpc_poll_endpoint_federal (_ ) ->
246+ Options = [{ssl , ldclient_config :tls_basic_certifi_options ()}],
247+ {ok , _ } = httpc :request (get , {" https://sdk.launchdarkly.us/sdk/latest-all" , [
248+ {" Authorization" , os :getenv (" LD_FED_SDK_KEY" )},
249+ {" User-Agent" , ldclient_config :get_user_agent ()}
250+ ]}, Options , []).
251+
252+ check_certifi_httpc_events_endpoint (_ ) ->
253+ Options = [{ssl , ldclient_config :tls_basic_certifi_options ()}],
254+ {ok , _ } = httpc :request (post , {" https://events.launchdarkly.com/bulk" , [
255+ {" Authorization" , os :getenv (" LD_SDK_KEY" )},
256+ {" X-LaunchDarkly-Event-Schema" , ldclient_config :get_event_schema ()},
257+ {" User-Agent" , ldclient_config :get_user_agent ()}],
258+ " application/json" ,
259+ <<" [{\" endDate\" :1634839284004,\" features\" :{\" test-boolean-flag\" :{\" counters\" :[{\" count\" :1,\" unknown\" :false,\" value\" :true,\" variation\" :0,\" version\" :1}],\" default\" :\" default-value\" }},\" kind\" :\" summary\" ,\" startDate\" :1634839284004},{\" creationDate\" :1634839284004,\" kind\" :\" index\" ,\" user\" :{\" firstName\" :\" Tester\" ,\" key\" :\" 12345-track\" ,\" lastName\" :\" Testerson\" ,\" privateAttrs\" :[]}}]" >>
260+ }, Options , []).
261+
262+ check_certifi_httpc_events_endpoint_federal (_ ) ->
263+ Options = [{ssl , ldclient_config :tls_basic_certifi_options ()}],
264+ {ok , _ } = httpc :request (post , {" https://events.launchdarkly.us/bulk" , [
265+ {" Authorization" , os :getenv (" LD_FED_SDK_KEY" )},
266+ {" X-LaunchDarkly-Event-Schema" , ldclient_config :get_event_schema ()},
267+ {" User-Agent" , ldclient_config :get_user_agent ()}],
268+ " application/json" ,
269+ <<" [{\" endDate\" :1634839284004,\" features\" :{\" test-boolean-flag\" :{\" counters\" :[{\" count\" :1,\" unknown\" :false,\" value\" :true,\" variation\" :0,\" version\" :1}],\" default\" :\" default-value\" }},\" kind\" :\" summary\" ,\" startDate\" :1634839284004},{\" creationDate\" :1634839284004,\" kind\" :\" index\" ,\" user\" :{\" firstName\" :\" Tester\" ,\" key\" :\" 12345-track\" ,\" lastName\" :\" Testerson\" ,\" privateAttrs\" :[]}}]" >>
270+ }, Options , []).
0 commit comments