diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index e92129d..0000000 --- a/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -# Telling GIT that Xcode pbxproj remote and local files -# should be merged using union of differences -*.pbxproj binary merge=union - diff --git a/.gitignore b/.gitignore index c936c9b..0e76568 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ DerivedData *.perspectivev3 !default.perspectivev3 xcuserdata/ +Scripts/environment.rb ## Other *.xccheckout @@ -47,4 +48,3 @@ playground.xcworkspace # Carthage/Checkouts Carthage/Build - diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec new file mode 100644 index 0000000..397d94a --- /dev/null +++ b/OpenVPNAdapter.podspec @@ -0,0 +1,137 @@ +# +# Be sure to run `pod spec lint OpenVPNAdapter.podspec' to ensure this is a +# valid spec and to remove all comments including this before submitting the spec. +# +# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html +# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ +# + +Pod::Spec.new do |s| + + # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # These will help people to find your library, and whilst it + # can feel like a chore to fill in it's definitely to your advantage. The + # summary should be tweet-length, and the description more in depth. + # + + s.name = "OpenVPNAdapter" + s.version = "0.0.1" + s.summary = "A short description of OpenVPNAdapter." + + # This description is used to generate tags and improve search results. + # * Think: What does it do? Why did you write it? What is the focus? + # * Try to keep it short, snappy and to the point. + # * Write the description between the DESC delimiters below. + # * Finally, don't worry about the indent, CocoaPods strips it! + s.description = <<-DESC + DESC + + s.homepage = "http://EXAMPLE/OpenVPNAdapter" + # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" + + + # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Licensing your code is important. See http://choosealicense.com for more info. + # CocoaPods will detect a license file if there is a named LICENSE* + # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. + # + + s.license = "MIT (example)" + # s.license = { :type => "MIT", :file => "FILE_LICENSE" } + + + # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Specify the authors of the library, with email addresses. Email addresses + # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also + # accepts just a name if you'd rather not provide an email address. + # + # Specify a social_media_url where others can refer to, for example a twitter + # profile URL. + # + + s.author = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } + # Or just: s.author = "Sergey Abramchuk" + # s.authors = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } + # s.social_media_url = "http://twitter.com/Sergey Abramchuk" + + # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # If this Pod runs only on iOS or OS X, then specify the platform and + # the deployment target. You can optionally include the target after the platform. + # + + # s.platform = :ios + # s.platform = :ios, "5.0" + + # When using multiple platforms + # s.ios.deployment_target = "5.0" + # s.osx.deployment_target = "10.7" + # s.watchos.deployment_target = "2.0" + # s.tvos.deployment_target = "9.0" + + + # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Specify the location from where the source should be retrieved. + # Supports git, hg, bzr, svn and HTTP. + # + + s.source = { :git => "http://EXAMPLE/OpenVPNAdapter.git", :tag => "#{s.version}" } + + + # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # CocoaPods is smart about how it includes source code. For source files + # giving a folder will include any swift, h, m, mm, c & cpp files. + # For header files it will include any header in the folder. + # Not including the public_header_files will make all headers public. + # + + s.source_files = "Classes", "Classes/**/*.{h,m}" + s.exclude_files = "Classes/Exclude" + + # s.public_header_files = "Classes/**/*.h" + + + # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # A list of resources included with the Pod. These are copied into the + # target bundle with a build phase script. Anything else will be cleaned. + # You can preserve files from being cleaned, please don't preserve + # non-essential files like tests, examples and documentation. + # + + # s.resource = "icon.png" + # s.resources = "Resources/*.png" + + # s.preserve_paths = "FilesToSave", "MoreFilesToSave" + + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + # s.libraries = "iconv", "xml2" + + + # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # If your library depends on compiler flags you can set them in the xcconfig hash + # where they will only apply to your library. If you depend on other Podspecs + # you can include multiple dependencies to ensure it works. + + # s.requires_arc = true + + # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } + # s.dependency "JSONKit", "~> 1.4" + +end diff --git a/OpenVPNAdapter.xcodeproj/project.pbxproj b/OpenVPNAdapter.xcodeproj/project.pbxproj index 35b9178..a35a398 100644 --- a/OpenVPNAdapter.xcodeproj/project.pbxproj +++ b/OpenVPNAdapter.xcodeproj/project.pbxproj @@ -35,6 +35,10 @@ C915F2231F61B0E700B3DF23 /* keyfile-decrypted.3des in Resources */ = {isa = PBXBuildFile; fileRef = C915F2211F61B0E700B3DF23 /* keyfile-decrypted.3des */; }; C915F2251F61B22300B3DF23 /* test-ca.crt in Resources */ = {isa = PBXBuildFile; fileRef = C915F2241F61B22300B3DF23 /* test-ca.crt */; }; C915F2261F61B22300B3DF23 /* test-ca.crt in Resources */ = {isa = PBXBuildFile; fileRef = C915F2241F61B22300B3DF23 /* test-ca.crt */; }; + C924E19E215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */; }; + C924E19F215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */; }; + C924E1A2215CF37300AEDEB5 /* environment.rb.example in Resources */ = {isa = PBXBuildFile; fileRef = C924E1A1215CF37300AEDEB5 /* environment.rb.example */; }; + C924E1A3215CF37300AEDEB5 /* environment.rb.example in Resources */ = {isa = PBXBuildFile; fileRef = C924E1A1215CF37300AEDEB5 /* environment.rb.example */; }; C9310BBE20FF63A400838910 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9310BBD20FF63A400838910 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; C9310BC120FF6E9700838910 /* Umbrella-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = C9310BC020FF6E9700838910 /* Umbrella-Header.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9310BC220FF6E9700838910 /* Umbrella-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = C9310BC020FF6E9700838910 /* Umbrella-Header.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -91,16 +95,12 @@ C9657A681EB0D73200EFF210 /* OpenVPNMinTLSVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = C9657A661EB0D73200EFF210 /* OpenVPNMinTLSVersion.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9657A6A1EB0D75700EFF210 /* OpenVPNTLSCertProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = C9657A691EB0D75700EFF210 /* OpenVPNTLSCertProfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9657A6B1EB0D75700EFF210 /* OpenVPNTLSCertProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = C9657A691EB0D75700EFF210 /* OpenVPNTLSCertProfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C98467A21EAA559B00272A9A /* local_vpn_server.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */; }; - C98467A31EAA559B00272A9A /* local_vpn_server.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */; }; C98467A61EAA5B7700272A9A /* OpenVPNConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = C98467A41EAA5B7700272A9A /* OpenVPNConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; C98467A71EAA5B7700272A9A /* OpenVPNConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = C98467A41EAA5B7700272A9A /* OpenVPNConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; C98467A81EAA5B7700272A9A /* OpenVPNConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = C98467A51EAA5B7700272A9A /* OpenVPNConfiguration.mm */; }; C98467A91EAA5B7700272A9A /* OpenVPNConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = C98467A51EAA5B7700272A9A /* OpenVPNConfiguration.mm */; }; C98467AB1EAA5BE100272A9A /* OpenVPNConfiguration+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C98467AA1EAA5BB500272A9A /* OpenVPNConfiguration+Internal.h */; }; C98467AC1EAA5BE200272A9A /* OpenVPNConfiguration+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C98467AA1EAA5BB500272A9A /* OpenVPNConfiguration+Internal.h */; }; - C9B03A7C1EABA82200268B85 /* ProfileLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9B03A7A1EABA6B500268B85 /* ProfileLoader.swift */; }; - C9B03A7D1EABA82300268B85 /* ProfileLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9B03A7A1EABA6B500268B85 /* ProfileLoader.swift */; }; C9B7955E1F1D16AA00CF35FE /* OpenVPNReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B7955C1F1D16AA00CF35FE /* OpenVPNReachability.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9B7955F1F1D16AA00CF35FE /* OpenVPNReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B7955C1F1D16AA00CF35FE /* OpenVPNReachability.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9B795601F1D16AA00CF35FE /* OpenVPNReachability.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9B7955D1F1D16AA00CF35FE /* OpenVPNReachability.mm */; }; @@ -122,8 +122,6 @@ C9BCE25B1EB3C0D9009D6AC1 /* OpenVPNSessionToken.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9BCE2571EB3C0D9009D6AC1 /* OpenVPNSessionToken.mm */; }; C9BCE25E1EB3C201009D6AC1 /* OpenVPNSessionToken+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BCE25C1EB3C201009D6AC1 /* OpenVPNSessionToken+Internal.h */; }; C9BCE25F1EB3C201009D6AC1 /* OpenVPNSessionToken+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BCE25C1EB3C201009D6AC1 /* OpenVPNSessionToken+Internal.h */; }; - C9C1E4101FA47117006ECA7D /* remote_vpn_server.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9C1E40F1FA47117006ECA7D /* remote_vpn_server.ovpn */; }; - C9C1E4111FA47117006ECA7D /* remote_vpn_server.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9C1E40F1FA47117006ECA7D /* remote_vpn_server.ovpn */; }; C9C1E4141FA475B7006ECA7D /* CustomFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9C1E4131FA475B7006ECA7D /* CustomFlow.swift */; }; C9C1E4151FA475B7006ECA7D /* CustomFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9C1E4131FA475B7006ECA7D /* CustomFlow.swift */; }; C9C2B2B7200CB42F00CA0FF3 /* OpenVPNAdapterPacketFlow.h in Headers */ = {isa = PBXBuildFile; fileRef = C9C2B2B6200CB42F00CA0FF3 /* OpenVPNAdapterPacketFlow.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -199,6 +197,10 @@ C915F21E1F6199E300B3DF23 /* keyfile-encrypted.3des */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "keyfile-encrypted.3des"; sourceTree = ""; }; C915F2211F61B0E700B3DF23 /* keyfile-decrypted.3des */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "keyfile-decrypted.3des"; sourceTree = ""; }; C915F2241F61B22300B3DF23 /* test-ca.crt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "test-ca.crt"; sourceTree = ""; }; + C924E19C215CE9BC00AEDEB5 /* vpn_profile_template.erb */ = {isa = PBXFileReference; lastKnownFileType = text; path = vpn_profile_template.erb; sourceTree = ""; }; + C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNProfile.swift; sourceTree = ""; }; + C924E1A0215CEDE600AEDEB5 /* fill_vpn_profile.rb */ = {isa = PBXFileReference; lastKnownFileType = text.script.ruby; path = fill_vpn_profile.rb; sourceTree = ""; }; + C924E1A1215CF37300AEDEB5 /* environment.rb.example */ = {isa = PBXFileReference; lastKnownFileType = text; path = environment.rb.example; sourceTree = ""; }; C9310BBD20FF63A400838910 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; C9310BC020FF6E9700838910 /* Umbrella-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Umbrella-Header.h"; path = "OpenVPNAdapter/Umbrella-Header.h"; sourceTree = ""; }; C9354F431F1E49A500F4C935 /* OpenVPNReachabilityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNReachabilityTests.swift; sourceTree = ""; }; @@ -227,11 +229,9 @@ C9657A631EB0D6AD00EFF210 /* OpenVPNCompressionMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OpenVPNCompressionMode.h; path = OpenVPNAdapter/OpenVPNCompressionMode.h; sourceTree = ""; }; C9657A661EB0D73200EFF210 /* OpenVPNMinTLSVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNMinTLSVersion.h; path = OpenVPNAdapter/OpenVPNMinTLSVersion.h; sourceTree = ""; }; C9657A691EB0D75700EFF210 /* OpenVPNTLSCertProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNTLSCertProfile.h; path = OpenVPNAdapter/OpenVPNTLSCertProfile.h; sourceTree = ""; }; - C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = local_vpn_server.ovpn; sourceTree = ""; }; C98467A41EAA5B7700272A9A /* OpenVPNConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNConfiguration.h; path = OpenVPNAdapter/OpenVPNConfiguration.h; sourceTree = ""; }; C98467A51EAA5B7700272A9A /* OpenVPNConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenVPNConfiguration.mm; path = OpenVPNAdapter/OpenVPNConfiguration.mm; sourceTree = ""; }; C98467AA1EAA5BB500272A9A /* OpenVPNConfiguration+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "OpenVPNConfiguration+Internal.h"; path = "OpenVPNAdapter/OpenVPNConfiguration+Internal.h"; sourceTree = ""; }; - C9B03A7A1EABA6B500268B85 /* ProfileLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfileLoader.swift; sourceTree = ""; }; C9B7955C1F1D16AA00CF35FE /* OpenVPNReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNReachability.h; path = OpenVPNAdapter/OpenVPNReachability.h; sourceTree = ""; }; C9B7955D1F1D16AA00CF35FE /* OpenVPNReachability.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenVPNReachability.mm; path = OpenVPNAdapter/OpenVPNReachability.mm; sourceTree = ""; }; C9B795621F1D182500CF35FE /* OpenVPNReachabilityTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNReachabilityTracker.h; path = OpenVPNAdapter/OpenVPNReachabilityTracker.h; sourceTree = ""; }; @@ -247,7 +247,6 @@ C9BCE2561EB3C0D9009D6AC1 /* OpenVPNSessionToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNSessionToken.h; path = OpenVPNAdapter/OpenVPNSessionToken.h; sourceTree = ""; }; C9BCE2571EB3C0D9009D6AC1 /* OpenVPNSessionToken.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenVPNSessionToken.mm; path = OpenVPNAdapter/OpenVPNSessionToken.mm; sourceTree = ""; }; C9BCE25C1EB3C201009D6AC1 /* OpenVPNSessionToken+Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OpenVPNSessionToken+Internal.h"; path = "OpenVPNAdapter/OpenVPNSessionToken+Internal.h"; sourceTree = ""; }; - C9C1E40F1FA47117006ECA7D /* remote_vpn_server.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = remote_vpn_server.ovpn; sourceTree = ""; }; C9C1E4131FA475B7006ECA7D /* CustomFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomFlow.swift; sourceTree = ""; }; C9C2B2B6200CB42F00CA0FF3 /* OpenVPNAdapterPacketFlow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OpenVPNAdapterPacketFlow.h; path = OpenVPNAdapter/OpenVPNAdapterPacketFlow.h; sourceTree = ""; }; C9C2B2B9200CC42A00CA0FF3 /* OpenVPNPacket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OpenVPNPacket.h; path = OpenVPNAdapter/OpenVPNPacket.h; sourceTree = ""; }; @@ -322,6 +321,7 @@ isa = PBXGroup; children = ( C90BAD251E73F47E00DEFB32 /* Configuration */, + C924E19B215CE76600AEDEB5 /* Scripts */, C9BB475D1E71663A00F3F98C /* Sources */, C9BB478F1E71821A00F3F98C /* Tests */, C91031031E47237A0004DFFE /* Products */, @@ -395,6 +395,24 @@ path = ..; sourceTree = ""; }; + C924E19A215CE50B00AEDEB5 /* Extensions */ = { + isa = PBXGroup; + children = ( + C9BB47A11E7183DB00F3F98C /* Bundle.swift */, + ); + name = Extensions; + sourceTree = ""; + }; + C924E19B215CE76600AEDEB5 /* Scripts */ = { + isa = PBXGroup; + children = ( + C924E19C215CE9BC00AEDEB5 /* vpn_profile_template.erb */, + C924E1A1215CF37300AEDEB5 /* environment.rb.example */, + C924E1A0215CEDE600AEDEB5 /* fill_vpn_profile.rb */, + ); + path = Scripts; + sourceTree = ""; + }; C9310BBF20FF667F00838910 /* OpenVPNAdapter */ = { isa = PBXGroup; children = ( @@ -524,9 +542,8 @@ C9BB479E1E7183B800F3F98C /* Libraries */ = { isa = PBXGroup; children = ( - C9C1E40E1FA470EB006ECA7D /* Configuration */, - C9C1E4121FA47586006ECA7D /* Base */, C9BB479F1E7183C200F3F98C /* Helpers */, + C924E19A215CE50B00AEDEB5 /* Extensions */, ); name = Libraries; sourceTree = ""; @@ -534,37 +551,12 @@ C9BB479F1E7183C200F3F98C /* Helpers */ = { isa = PBXGroup; children = ( - C9BB47A01E7183CA00F3F98C /* Utils */, + C9C1E4131FA475B7006ECA7D /* CustomFlow.swift */, + C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */, ); name = Helpers; sourceTree = ""; }; - C9BB47A01E7183CA00F3F98C /* Utils */ = { - isa = PBXGroup; - children = ( - C9BB47A11E7183DB00F3F98C /* Bundle.swift */, - C9B03A7A1EABA6B500268B85 /* ProfileLoader.swift */, - ); - name = Utils; - sourceTree = ""; - }; - C9C1E40E1FA470EB006ECA7D /* Configuration */ = { - isa = PBXGroup; - children = ( - C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */, - C9C1E40F1FA47117006ECA7D /* remote_vpn_server.ovpn */, - ); - name = Configuration; - sourceTree = ""; - }; - C9C1E4121FA47586006ECA7D /* Base */ = { - isa = PBXGroup; - children = ( - C9C1E4131FA475B7006ECA7D /* CustomFlow.swift */, - ); - name = Base; - sourceTree = ""; - }; C9CA4DD01F602D8300C4F184 /* Certificates and Keys */ = { isa = PBXGroup; children = ( @@ -715,6 +707,7 @@ isa = PBXNativeTarget; buildConfigurationList = C9BB47961E71821A00F3F98C /* Build configuration list for PBXNativeTarget "OpenVPNAdapter iOS Tests" */; buildPhases = ( + C924E1A5215D15C600AEDEB5 /* Fill VPN Profile */, C9BB478A1E71821A00F3F98C /* Sources */, C9BB478B1E71821A00F3F98C /* Frameworks */, C9BB478C1E71821A00F3F98C /* Resources */, @@ -752,6 +745,7 @@ isa = PBXNativeTarget; buildConfigurationList = C9D2ABFC1EA212A3007EDF9D /* Build configuration list for PBXNativeTarget "OpenVPNAdapter macOS Tests" */; buildPhases = ( + C924E1A4215D021B00AEDEB5 /* Fill VPN Profile */, C9D2ABF51EA212A3007EDF9D /* Sources */, C9D2ABF81EA212A3007EDF9D /* Frameworks */, C9D2ABFA1EA212A3007EDF9D /* Resources */, @@ -828,11 +822,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C98467A21EAA559B00272A9A /* local_vpn_server.ovpn in Resources */, C915F2221F61B0E700B3DF23 /* keyfile-decrypted.3des in Resources */, C915F2251F61B22300B3DF23 /* test-ca.crt in Resources */, - C9C1E4101FA47117006ECA7D /* remote_vpn_server.ovpn in Resources */, C915F21F1F6199E300B3DF23 /* keyfile-encrypted.3des in Resources */, + C924E1A2215CF37300AEDEB5 /* environment.rb.example in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -847,17 +840,52 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C98467A31EAA559B00272A9A /* local_vpn_server.ovpn in Resources */, C915F2231F61B0E700B3DF23 /* keyfile-decrypted.3des in Resources */, C915F2261F61B22300B3DF23 /* test-ca.crt in Resources */, - C9C1E4111FA47117006ECA7D /* remote_vpn_server.ovpn in Resources */, C915F2201F6199E300B3DF23 /* keyfile-encrypted.3des in Resources */, + C924E1A3215CF37300AEDEB5 /* environment.rb.example in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + C924E1A4215D021B00AEDEB5 /* Fill VPN Profile */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Fill VPN Profile"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "ruby \"${SRCROOT}/Scripts/fill_vpn_profile.rb\"\n"; + }; + C924E1A5215D15C600AEDEB5 /* Fill VPN Profile */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Fill VPN Profile"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "ruby \"${SRCROOT}/Scripts/fill_vpn_profile.rb\"\n"; + }; C9BB476E1E716E7000F3F98C /* Check Warning And Error Tags */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -921,10 +949,10 @@ buildActionMask = 2147483647; files = ( C9C1E4141FA475B7006ECA7D /* CustomFlow.swift in Sources */, + C924E19E215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */, C94605E91EAA656B00971516 /* OpenVPNConfigurationTests.swift in Sources */, C9BB47911E71821A00F3F98C /* OpenVPNAdapterTests.swift in Sources */, C915F1F91F615BB400B3DF23 /* OpenVPNPrivateKeyTests.swift in Sources */, - C9B03A7C1EABA82200268B85 /* ProfileLoader.swift in Sources */, C9CA4DE11F603A5300C4F184 /* OpenVPNCertificateTests.swift in Sources */, C9BB47A21E7183DB00F3F98C /* Bundle.swift in Sources */, ); @@ -961,12 +989,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + C924E19F215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */, C94605EA1EAA65F200971516 /* OpenVPNConfigurationTests.swift in Sources */, C9D2ABF61EA212A3007EDF9D /* OpenVPNAdapterTests.swift in Sources */, C9CA4DE21F603A5300C4F184 /* OpenVPNCertificateTests.swift in Sources */, C9354F471F1E4AE200F4C935 /* OpenVPNReachabilityTests.swift in Sources */, C915F1FA1F615BB400B3DF23 /* OpenVPNPrivateKeyTests.swift in Sources */, - C9B03A7D1EABA82300268B85 /* ProfileLoader.swift in Sources */, C9C1E4151FA475B7006ECA7D /* CustomFlow.swift in Sources */, C9D2ABF71EA212A3007EDF9D /* Bundle.swift in Sources */, ); diff --git a/OpenVPNAdapter.xcodeproj/xcshareddata/xcschemes/OpenVPNAdapter macOS.xcscheme b/OpenVPNAdapter.xcodeproj/xcshareddata/xcschemes/OpenVPNAdapter macOS.xcscheme index b96842b..77d4e25 100644 --- a/OpenVPNAdapter.xcodeproj/xcshareddata/xcschemes/OpenVPNAdapter macOS.xcscheme +++ b/OpenVPNAdapter.xcodeproj/xcshareddata/xcschemes/OpenVPNAdapter macOS.xcscheme @@ -27,7 +27,7 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" codeCoverageEnabled = "YES" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "NO"> diff --git a/Scripts/environment.rb.example b/Scripts/environment.rb.example new file mode 100644 index 0000000..86f6e62 --- /dev/null +++ b/Scripts/environment.rb.example @@ -0,0 +1,64 @@ +# Your OpenVPN username +if ENV["OPENVPN_USERNAME"].nil? + ENV["OPENVPN_USERNAME"] = "Username" +end + +# Your OpenVPN password +if ENV["OPENVPN_PASSWORD"].nil? + ENV["OPENVPN_PASSWORD"] = "Password" +end + +# Your OpenVPN configuration +if ENV["OPENVPN_CONFIGURATION"].nil? + ENV["OPENVPN_CONFIGURATION"] = <<~END + client + dev tun + proto udp + + remote X.X.X.X 1194 + + remote-random + resolv-retry infinite + nobind + cipher AES-256-CBC + auth SHA512 + comp-lzo no + verb 3 + + tun-mtu 1500 + tun-mtu-extra 32 + mssfix 1450 + persist-key + persist-tun + + reneg-sec 0 + + remote-cert-tls server + auth-user-pass + pull + fast-io + + + -----BEGIN CERTIFICATE----- + ... + -----END CERTIFICATE----- + + + key-direction 1 + + + # 2048 bit OpenVPN static key + -----BEGIN OpenVPN Static key V1----- + ... + -----END OpenVPN Static key V1----- + + END +end + +if ENV["OPENVPN_REMOTE_HOST"].nil? + ENV["OPENVPN_REMOTE_HOST"] = "Remote Host Address" +end + +if ENV["OPENVPN_REMOTE_PORT"].nil? + ENV["OPENVPN_REMOTE_PORT"] = "Remote Host Port" +end diff --git a/Scripts/fill_vpn_profile.rb b/Scripts/fill_vpn_profile.rb new file mode 100644 index 0000000..9259968 --- /dev/null +++ b/Scripts/fill_vpn_profile.rb @@ -0,0 +1,35 @@ +environment_file = File.join(ENV["SRCROOT"], "Scripts", "environment.rb") +if File.exist?(environment_file) + require "#{environment_file}" +end + +require "erb" + +if ENV["OPENVPN_USERNAME"].nil? || ENV["OPENVPN_PASSWORD"].nil? || ENV["OPENVPN_CONFIGURATION"].nil? + puts "warning: VPN profile data is missing, you need to fill VPNProfile.swift manually." + exit(true) +end + +template_file = File.join(ENV["SRCROOT"], "Scripts", "vpn_profile_template.erb") +unless File.exist?(template_file) + puts "error: Template file does not exist." + exit(false) +end + +output_file = File.join(ENV["SRCROOT"], "Tests", "VPNProfile.swift") +unless File.exist?(output_file) + puts "error: Output file does not exist." + exit(false) +end + +OPENVPN_USERNAME = ENV["OPENVPN_USERNAME"] +OPENVPN_PASSWORD = ENV["OPENVPN_PASSWORD"] +OPENVPN_CONFIGURATION = ENV["OPENVPN_CONFIGURATION"] +OPENVPN_REMOTE_HOST = ENV["OPENVPN_REMOTE_HOST"] +OPENVPN_REMOTE_PORT = ENV["OPENVPN_REMOTE_PORT"] + +template_content = File.read(template_file) +erb_template = ERB.new(template_content, nil, ">") + +result = erb_template.result +File.write(output_file, result) diff --git a/Scripts/vpn_profile_template.erb b/Scripts/vpn_profile_template.erb new file mode 100644 index 0000000..4aa7336 --- /dev/null +++ b/Scripts/vpn_profile_template.erb @@ -0,0 +1,25 @@ +// +// VPNProfile.swift +// OpenVPNAdapter +// +// Created by Sergey Abramchuk on 27/09/2018. +// +// Do not commit changes of this file to the repo! + +import Foundation + +struct VPNProfile { + + static let username: String = "<%= OPENVPN_USERNAME %>" + static let password: String = "<%= OPENVPN_PASSWORD %>" + + static let configuration: String = """ +<% OPENVPN_CONFIGURATION.each_line do |line| %> + <%= line %> +<% end %> + """ + + static let remoteHost: String = "<%= OPENVPN_REMOTE_HOST %>" + static let remotePort: Int = <%= OPENVPN_REMOTE_PORT %> + +} diff --git a/Tests/OpenVPNAdapterTests.swift b/Tests/OpenVPNAdapterTests.swift index 40a83f6..209329e 100644 --- a/Tests/OpenVPNAdapterTests.swift +++ b/Tests/OpenVPNAdapterTests.swift @@ -30,12 +30,14 @@ class OpenVPNAdapterTests: XCTestCase { } func testApplyConfiguration() { + guard let vpnConfiguration = VPNProfile.configuration.data(using: .utf8) else { fatalError() } + let adapter = OpenVPNAdapter() - + let configuration = OpenVPNConfiguration() - configuration.fileContent = ProfileLoader.getVPNProfile(type: .localVPNServer) + configuration.fileContent = vpnConfiguration configuration.settings = ["auth-user-pass": ""] - + let result: OpenVPNProperties do { result = try adapter.apply(configuration: configuration) @@ -43,10 +45,9 @@ class OpenVPNAdapterTests: XCTestCase { XCTFail("Failed to configure OpenVPN adapted due to error: \(error)") return } - - XCTAssert(result.remoteHost == "192.168.1.200") - XCTAssert(result.remotePort == 1194) - XCTAssert(result.remoteProto == .UDP) + + XCTAssert(result.remoteHost == VPNProfile.remoteHost) + XCTAssert(result.remotePort == VPNProfile.remotePort) XCTAssert(result.autologin == false) } @@ -65,67 +66,28 @@ class OpenVPNAdapterTests: XCTestCase { } } - // Test connection with local VPN server - func testLocalConection() { - let adapter = OpenVPNAdapter() - - let configuration = OpenVPNConfiguration() - configuration.fileContent = ProfileLoader.getVPNProfile(type: .localVPNServer) - configuration.settings = ["auth-user-pass": ""] - - let result: OpenVPNProperties - do { - result = try adapter.apply(configuration: configuration) - } catch { - XCTFail("Failed to configure OpenVPN adapted due to error: \(error)") - return - } - - guard !result.autologin else { - XCTFail() - return - } - - let credentials = OpenVPNCredentials() - credentials.username = "testuser" - credentials.password = "nonsecure" - - do { - try adapter.provide(credentials: credentials) - } catch { - XCTFail("Failed to provide credentials. \(error)") - return - } - - expectations[.connection] = expectation(description: "me.ss-abramchuk.openvpn-adapter.connection") - - adapter.delegate = self - adapter.connect() - - waitForExpectations(timeout: 30.0) { (error) in - adapter.disconnect() - } - } - // Test connection with remote VPN server - func testRemoteConnection() { + // Test connection to the VPN server + func testConnection() { + guard let vpnConfiguration = VPNProfile.configuration.data(using: .utf8) else { fatalError() } + let adapter = OpenVPNAdapter() - + let configuration = OpenVPNConfiguration() - configuration.fileContent = ProfileLoader.getVPNProfile(type: .remoteVPNServer) - + configuration.fileContent = vpnConfiguration + do { _ = try adapter.apply(configuration: configuration) } catch { XCTFail("Failed to configure OpenVPN adapted due to error: \(error)") return } - + expectations[.connection] = expectation(description: "me.ss-abramchuk.openvpn-adapter.connection") - + adapter.delegate = self adapter.connect() - + waitForExpectations(timeout: 30.0) { (error) in adapter.disconnect() } @@ -155,9 +117,11 @@ extension OpenVPNAdapterTests: OpenVPNAdapterDelegate { func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleError error: Error) { if let connectionExpectation = expectations[.connection] { - XCTFail("Failed to establish conection. \(error.localizedDescription)") + XCTFail("Failed to establish conection.") connectionExpectation.fulfill() } + + dump(error) } func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleLogMessage logMessage: String) { diff --git a/Tests/OpenVPNConfigurationTests.swift b/Tests/OpenVPNConfigurationTests.swift index dcb2aef..7b5e343 100644 --- a/Tests/OpenVPNConfigurationTests.swift +++ b/Tests/OpenVPNConfigurationTests.swift @@ -24,7 +24,7 @@ class OpenVPNConfigurationTests: XCTestCase { } func testGetSetProfile() { - let originalProfile = ProfileLoader.getVPNProfile(type: .localVPNServer) + guard let originalProfile = VPNProfile.configuration.data(using: .utf8) else { fatalError() } let configuration = OpenVPNConfiguration() diff --git a/Tests/ProfileLoader.swift b/Tests/ProfileLoader.swift deleted file mode 100644 index f157590..0000000 --- a/Tests/ProfileLoader.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// ProfileLoader.swift -// OpenVPN Adapter -// -// Created by Sergey Abramchuk on 22.04.17. -// -// - -import Foundation - -enum ProfileType: String { - case localVPNServer = "local_vpn_server" - case remoteVPNServer = "remote_vpn_server" -} - -struct ProfileLoader { - - static func getVPNProfile(type: ProfileType) -> Data { - let fileName = type.rawValue - - guard - let path = Bundle.current.url(forResource: fileName, withExtension: "ovpn"), - let profile = try? Data(contentsOf: path) - else { - fatalError("Failed to retrieve OpenVPN profile") - } - - return profile - } - -} - diff --git a/Tests/VPNProfile.swift b/Tests/VPNProfile.swift new file mode 100644 index 0000000..1b7d9ba --- /dev/null +++ b/Tests/VPNProfile.swift @@ -0,0 +1,19 @@ +// +// VPNProfile.swift +// OpenVPNAdapter +// +// Created by Sergey Abramchuk on 27/09/2018. +// +// Do not commit changes of this file to the repo! + +import Foundation + +struct VPNProfile { + static let username: String = <#OPENVPN_USERNAME#> + static let password: String = <#OPENVPN_PASSWORD#> + + static let configuration: String = <#OPENVPN_CONFIGURATION#> + + static let remoteHost: String = <#OPENVPN_REMOTE_HOST#> + static let remotePort: Int = <#OPENVPN_REMOTE_PORT#> +} diff --git a/Tests/local_vpn_server.ovpn b/Tests/local_vpn_server.ovpn deleted file mode 100644 index e07238c..0000000 --- a/Tests/local_vpn_server.ovpn +++ /dev/null @@ -1,89 +0,0 @@ -dev tun -proto udp -remote 192.168.1.200 1194 -cipher AES-256-CBC -resolv-retry infinite -nobind -persist-key -persist-tun -client -verb 3 - ------BEGIN CERTIFICATE----- -MIIDpjCCAo6gAwIBAgIBADANBgkqhkiG9w0BAQsFADBSMRUwEwYDVQQDEww5ZTQ3 -NThlOTVlZTIxFTATBgNVBAoTDDllNDc1OGU5NWVlMjEVMBMGA1UECxMMOWU0NzU4 -ZTk1ZWUyMQswCQYDVQQGEwJVUzAeFw0xNzA0MjgxODU3MjhaFw0zNzEyMzExODU3 -MjhaMFIxFTATBgNVBAMTDDllNDc1OGU5NWVlMjEVMBMGA1UEChMMOWU0NzU4ZTk1 -ZWUyMRUwEwYDVQQLEww5ZTQ3NThlOTVlZTIxCzAJBgNVBAYTAlVTMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3ecfScl3JGwRhbmHgIrNx7LItVyTX9V3 -CSZOjBOZymXIKt7/vNt9w6suebtK64/YCRAyPsUbvqUwYqfZhd6jngua/917LrnO -SKHMrGtwDLfnxKY3WTPl1tI5GlrojgF2Z3wCgzRr/+KkFAk8Fq2iffJDRi2Iptqn -5PlOosGfpA1fQKYsedKx7DAXbwTvXPbE/tJ0m8WfdiHIUkWWrNxAFOuctWLk+oBi -vAmlb3/GSctXEIcVPHdF5AKU/GR5AjY1Qqde4LcMS+54YV+g/rpFYNUFsySNSvLQ -Lxg3zZ79HAd9DMwYSt47MP9pih8dT2jdt7df6y+/RXq32B6SoqrYPwIDAQABo4GG -MIGDMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgH2MGMGA1UdJQRcMFoGCCsG -AQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGC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YoLv -xN1F0FW3bOoyEKJYgSvG6VGz4CrMbl6MnaIrPuU985UwNCh28UboBzXJivo0qLrx -rM+SQbyoe8JTbsjYU8Ge7Z4PFGdFCqolgcycF8UCgYBEVR50Ze1j8XK8oyySePqn -YN1/CPQHkMv4Z9J511uDOw+rZpo8BtZX19jj4MWpFtcR7EAj4OyCe8gdn7YRv/n9 -Hw+zm4o54mkL4tgWg0/9jt0eCR3j3Ph03mTlkqwE/PPXaRIb1E8EmEYSwT0hDzjc -Wb3dqIAxzkHucnvInG+TEw== ------END PRIVATE KEY----- - diff --git a/Tests/remote_vpn_server.ovpn b/Tests/remote_vpn_server.ovpn deleted file mode 100644 index ba0d432..0000000 --- a/Tests/remote_vpn_server.ovpn +++ /dev/null @@ -1,214 +0,0 @@ -############################################################################### -# OpenVPN 2.0 Sample Configuration File -# for PacketiX VPN / SoftEther VPN Server -# -# !!! AUTO-GENERATED BY SOFTETHER VPN SERVER MANAGEMENT TOOL !!! -# -# !!! YOU HAVE TO REVIEW IT BEFORE USE AND MODIFY IT AS NECESSARY !!! -# -# This configuration file is auto-generated. You might use this config file -# in order to connect to the PacketiX VPN / SoftEther VPN Server. -# However, before you try it, you should review the descriptions of the file -# to determine the necessity to modify to suitable for your real environment. -# If necessary, you have to modify a little adequately on the file. -# For example, the IP address or the hostname as a destination VPN Server -# should be confirmed. -# -# Note that to use OpenVPN 2.0, you have to put the certification file of -# the destination VPN Server on the OpenVPN Client computer when you use this -# config file. Please refer the below descriptions carefully. - - -############################################################################### -# Specify the type of the layer of the VPN connection. -# -# To connect to the VPN Server as a "Remote-Access VPN Client PC", -# specify 'dev tun'. (Layer-3 IP Routing Mode) -# -# To connect to the VPN Server as a bridging equipment of "Site-to-Site VPN", -# specify 'dev tap'. (Layer-2 Ethernet Bridgine Mode) - -dev tun - - -############################################################################### -# Specify the underlying protocol beyond the Internet. -# Note that this setting must be correspond with the listening setting on -# the VPN Server. -# -# Specify either 'proto tcp' or 'proto udp'. - -proto udp - - -############################################################################### -# The destination hostname / IP address, and port number of -# the target VPN Server. -# -# You have to specify as 'remote '. You can also -# specify the IP address instead of the hostname. -# -# Note that the auto-generated below hostname are a "auto-detected -# IP address" of the VPN Server. You have to confirm the correctness -# beforehand. -# -# When you want to connect to the VPN Server by using TCP protocol, -# the port number of the destination TCP port should be same as one of -# the available TCP listeners on the VPN Server. -# -# When you use UDP protocol, the port number must same as the configuration -# setting of "OpenVPN Server Compatible Function" on the VPN Server. - -remote vpn152461132.opengw.net 1840 - - -############################################################################### -# The HTTP/HTTPS proxy setting. -# -# Only if you have to use the Internet via a proxy, uncomment the below -# two lines and specify the proxy address and the port number. -# In the case of using proxy-authentication, refer the OpenVPN manual. - -;http-proxy-retry -;http-proxy [proxy server] [proxy port] - - -############################################################################### -# The encryption and authentication algorithm. -# -# Default setting is good. Modify it as you prefer. -# When you specify an unsupported algorithm, the error will occur. -# -# The supported algorithms are as follows: -# cipher: [NULL-CIPHER] NULL AES-128-CBC AES-192-CBC AES-256-CBC BF-CBC -# CAST-CBC CAST5-CBC DES-CBC DES-EDE-CBC DES-EDE3-CBC DESX-CBC -# RC2-40-CBC RC2-64-CBC RC2-CBC -# auth: SHA SHA1 MD5 MD4 RMD160 - -cipher AES-128-CBC -auth SHA1 - - -############################################################################### -# Other parameters necessary to connect to the VPN Server. -# -# It is not recommended to modify it unless you have a particular need. - -resolv-retry infinite -nobind -persist-key -persist-tun -client -verb 3 - - -############################################################################### -# The certificate file of the destination VPN Server. -# -# The CA certificate file is embedded in the inline format. -# You can replace this CA contents if necessary. -# Please note that if the server certificate is not a self-signed, you have to -# specify the signer's root certificate (CA) here. - - ------BEGIN CERTIFICATE----- -MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB -hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIEN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4E -FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB -/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl -wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM -4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV -2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna -FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ -CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK -boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke -jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL -S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb -QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl -0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB -NVOFBkpdn627G190 ------END CERTIFICATE----- - - - - -############################################################################### -# The client certificate file (dummy). -# -# In some implementations of OpenVPN Client software -# (for example: OpenVPN Client for iOS), -# a pair of client certificate and private key must be included on the -# configuration file due to the limitation of the client. -# So this sample configuration file has a dummy pair of client certificate -# and private key as follows. - - ------BEGIN CERTIFICATE----- -MIICxjCCAa4CAQAwDQYJKoZIhvcNAQEFBQAwKTEaMBgGA1UEAxMRVlBOR2F0ZUNs -aWVudENlcnQxCzAJBgNVBAYTAkpQMB4XDTEzMDIxMTAzNDk0OVoXDTM3MDExOTAz -MTQwN1owKTEaMBgGA1UEAxMRVlBOR2F0ZUNsaWVudENlcnQxCzAJBgNVBAYTAkpQ -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5h2lgQQYUjwoKYJbzVZA -5VcIGd5otPc/qZRMt0KItCFA0s9RwReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD -4W8GmJe8zapJnLsD39OSMRCzZJnczW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQ -CjntLIWk5OLLVkFt9/tScc1GDtci55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67 -XCKJnGB5nlQ+HsMYPV/O49Ld91ZN/2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6h -p/0yXnTB//mWutBGpdUlIbwiITbAmrsbYnjigRvnPqX1RNJUbi9Fp6C2c/HIFJGD -ywIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQChO5hgcw/4oWfoEFLu9kBa1B//kxH8 -hQkChVNn8BRC7Y0URQitPl3DKEed9URBDdg2KOAz77bb6ENPiliD+a38UJHIRMqe -UBHhllOHIzvDhHFbaovALBQceeBzdkQxsKQESKmQmR832950UCovoyRB61UyAV7h -+mZhYPGRKXKSJI6s0Egg/Cri+Cwk4bjJfrb5hVse11yh4D9MHhwSfCOH+0z4hPUT -Fku7dGavURO5SVxMn/sL6En5D+oSeXkadHpDs+Airym2YHh15h0+jPSOoR6yiVp/ -6zZeZkrN43kuS73KpKDFjfFPh8t4r1gOIjttkNcQqBccusnplQ7HJpsk ------END CERTIFICATE----- - - - - ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEA5h2lgQQYUjwoKYJbzVZA5VcIGd5otPc/qZRMt0KItCFA0s9R -wReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD4W8GmJe8zapJnLsD39OSMRCzZJnc -zW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQCjntLIWk5OLLVkFt9/tScc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