File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,44 @@ pub unsafe fn set_verify_owner_validation(enabled: bool) -> Result<(), Error> {
195
195
Ok ( ( ) )
196
196
}
197
197
198
+ /// Set the SSL certificate-authority location to `file`. `file` is the location
199
+ /// of a file containing several certificates concatenated together.
200
+ pub unsafe fn set_ssl_cert_file < P > ( file : P ) -> Result < ( ) , Error >
201
+ where
202
+ P : IntoCString ,
203
+ {
204
+ crate :: init ( ) ;
205
+
206
+ unsafe {
207
+ try_call ! ( raw:: git_libgit2_opts(
208
+ raw:: GIT_OPT_SET_SSL_CERT_LOCATIONS as libc:: c_int,
209
+ file. into_c_string( ) ?. as_ptr( ) ,
210
+ core:: ptr:: null:: <libc:: c_char>( )
211
+ ) ) ;
212
+ }
213
+
214
+ Ok ( ( ) )
215
+ }
216
+
217
+ /// Set the SSL certificate-authority location to `path`. `path` is the location
218
+ /// of a directory holding several certificates, one per file.
219
+ pub unsafe fn set_ssl_cert_dir < P > ( path : P ) -> Result < ( ) , Error >
220
+ where
221
+ P : IntoCString ,
222
+ {
223
+ crate :: init ( ) ;
224
+
225
+ unsafe {
226
+ try_call ! ( raw:: git_libgit2_opts(
227
+ raw:: GIT_OPT_SET_SSL_CERT_LOCATIONS as libc:: c_int,
228
+ core:: ptr:: null:: <libc:: c_char>( ) ,
229
+ path. into_c_string( ) ?. as_ptr( )
230
+ ) ) ;
231
+ }
232
+
233
+ Ok ( ( ) )
234
+ }
235
+
198
236
#[ cfg( test) ]
199
237
mod test {
200
238
use super :: * ;
You can’t perform that action at this time.
0 commit comments