File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,14 @@ export function enableSSLPinning(args: Observable.EventData) {
6161 context . set ( 'enabled' , true ) ;
6262}
6363
64+ export function enableSSLPinningExpired ( args : Observable . EventData ) {
65+ let dir = fs . knownFolders . currentApp ( ) . getFolder ( 'assets' ) ;
66+ let certificate = dir . getFile ( 'httpbin.org.expired.cer' ) . path ;
67+ Https . enableSSLPinning ( { host : 'httpbin.org' , certificate} ) ;
68+ let context = ( args . object as Page . View ) . bindingContext as Observable . Observable ;
69+ context . set ( 'enabled' , true ) ;
70+ }
71+
6472export function disableSSLPinning ( args : Observable . EventData ) {
6573 Https . disableSSLPinning ( ) ;
6674 let context = ( args . object as Page . View ) . bindingContext as Observable . Observable ;
Original file line number Diff line number Diff line change 99 <Button text =" GET Httpbin" tap =" getHttpbin" class =" t-20 btn btn-primary btn-active" />
1010 <Button text =" GET Httpbin (large response)" tap =" getHttpbinLargeResponse" class =" t-20 btn btn-primary btn-active" />
1111 <Button text =" POST Httpbin " tap =" postHttpbin" class =" t-20 btn btn-primary btn-active" />
12- <Button text =" Enable Httpbin SSL Pinning" tap =" enableSSLPinning" class =" t-20 btn btn-primary btn-active" />
13- <Button text =" Disable SSL Pinning" tap =" disableSSLPinning" class =" t-20 btn btn-primary btn-active" />
12+ <Button text =" Httpbin Pinning ON" tap =" enableSSLPinning" class =" t-20 btn btn-primary btn-active" />
13+ <Button text =" Httpbin Pinning ON, expired cert" tap =" enableSSLPinningExpired" class =" t-20 btn btn-primary btn-active" />
14+ <Button text =" Httpbin Pinning OFF" tap =" disableSSLPinning" class =" t-20 btn btn-primary btn-active" />
1415 <Label text =" Here's a spinner to show the main thread is not blocked by network IO" textWrap =" true" class =" m-20" />
1516 <ActivityIndicator busy =" true" />
1617 </StackLayout >
You can’t perform that action at this time.
0 commit comments