Update Demo

This commit is contained in:
Davide De Rosa 2019-05-23 23:25:35 +02:00
parent be1081aad6
commit adcae1686e
5 changed files with 19 additions and 17 deletions

View File

@ -39,7 +39,7 @@ import UIKit
import NetworkExtension
import TunnelKit
private let ca = CryptoContainer(pem: """
private let ca = OpenVPN.CryptoContainer(pem: """
-----BEGIN CERTIFICATE-----
MIIFqzCCBJOgAwIBAgIJAKZ7D5Yv87qDMA0GCSqGSIb3DQEBDQUAMIHoMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNVBAcTCkxvc0FuZ2VsZXMxIDAeBgNV
@ -86,9 +86,9 @@ extension ViewController {
let hostname = ((domain == "") ? server : [server, domain].joined(separator: "."))
let port = UInt16(textPort.text!)!
let credentials = SessionProxy.Credentials(textUsername.text!, textPassword.text!)
let credentials = OpenVPN.Credentials(textUsername.text!, textPassword.text!)
var sessionBuilder = SessionProxy.ConfigurationBuilder()
var sessionBuilder = OpenVPN.ConfigurationBuilder()
sessionBuilder.ca = ca
sessionBuilder.cipher = .aes128cbc
sessionBuilder.digest = .sha1
@ -98,7 +98,7 @@ extension ViewController {
let socketType: SocketType = switchTCP.isOn ? .tcp : .udp
sessionBuilder.endpointProtocols = [EndpointProtocol(socketType, port)]
sessionBuilder.usesPIAPatches = true
var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build())
var builder = OpenVPNTunnelProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build())
builder.mtu = 1350
builder.shouldDebug = true
builder.masksPrivateData = false
@ -218,7 +218,7 @@ class ViewController: UIViewController, URLSessionDataDelegate {
guard let vpn = currentManager?.connection as? NETunnelProviderSession else {
return
}
try? vpn.sendProviderMessage(TunnelKitProvider.Message.requestLog.data) { (data) in
try? vpn.sendProviderMessage(OpenVPNTunnelProvider.Message.requestLog.data) { (data) in
guard let data = data, let log = String(data: data, encoding: .utf8) else {
return
}

View File

@ -39,7 +39,7 @@ import Cocoa
import NetworkExtension
import TunnelKit
private let ca = CryptoContainer(pem: """
private let ca = OpenVPN.CryptoContainer(pem: """
-----BEGIN CERTIFICATE-----
MIIFqzCCBJOgAwIBAgIJAKZ7D5Yv87qDMA0GCSqGSIb3DQEBDQUAMIHoMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNVBAcTCkxvc0FuZ2VsZXMxIDAeBgNV
@ -86,9 +86,9 @@ extension ViewController {
let hostname = ((domain == "") ? server : [server, domain].joined(separator: "."))
let port = UInt16(textPort.stringValue)!
let credentials = SessionProxy.Credentials(textUsername.stringValue, textPassword.stringValue)
let credentials = OpenVPN.Credentials(textUsername.stringValue, textPassword.stringValue)
var sessionBuilder = SessionProxy.ConfigurationBuilder()
var sessionBuilder = OpenVPN.ConfigurationBuilder()
sessionBuilder.ca = ca
sessionBuilder.cipher = .aes128cbc
sessionBuilder.digest = .sha1
@ -99,7 +99,7 @@ extension ViewController {
let socketType: SocketType = .udp
sessionBuilder.endpointProtocols = [EndpointProtocol(socketType, port)]
sessionBuilder.usesPIAPatches = true
var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build())
var builder = OpenVPNTunnelProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build())
builder.mtu = 1350
builder.shouldDebug = true
builder.masksPrivateData = false

View File

@ -37,5 +37,5 @@
import TunnelKit
class PacketTunnelProvider: TunnelKitProvider {
class PacketTunnelProvider: OpenVPNTunnelProvider {
}

View File

@ -37,5 +37,5 @@
import TunnelKit
class PacketTunnelProvider: TunnelKitProvider {
class PacketTunnelProvider: OpenVPNTunnelProvider {
}

View File

@ -1,15 +1,17 @@
PODS:
- OpenSSL-Apple (1.1.0j.2)
- SwiftyBeaver (1.7.0)
- TunnelKit (1.6.3):
- TunnelKit/AppExtension (= 1.6.3)
- TunnelKit/Core (= 1.6.3)
- TunnelKit/AppExtension (1.6.3):
- TunnelKit (2.0.0):
- TunnelKit/Protocols/OpenVPN (= 2.0.0)
- TunnelKit/AppExtension (2.0.0):
- SwiftyBeaver
- TunnelKit/Core
- TunnelKit/Core (1.6.3):
- TunnelKit/Core (2.0.0):
- OpenSSL-Apple (~> 1.1.0j.2)
- SwiftyBeaver
- TunnelKit/Protocols/OpenVPN (2.0.0):
- TunnelKit/AppExtension
- TunnelKit/Core
DEPENDENCIES:
- TunnelKit (from `..`)
@ -26,7 +28,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
OpenSSL-Apple: e88e1eb314acb4a05e2348069790c4aa49f6d319
SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165
TunnelKit: ac8dad986e36e513303ed5d258c7e4aedb45c84b
TunnelKit: 821c15bb87aafae69eb8c63e4cc46d883fff8797
PODFILE CHECKSUM: f66dfaaa92a8d04ab2743f3caeab0ac9f9f25859