GithubHelp home page GithubHelp logo

halo / macosvpn Goto Github PK

View Code? Open in Web Editor NEW
429.0 19.0 72.0 1.83 MB

:wrench: Create macOS VPNs programmatically (L2TP & Cisco)

License: Other

Swift 79.77% Ruby 19.04% Shell 1.20%
l2tp ipsec cisco macos vpn keychain vpn-client ppp

macosvpn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macosvpn's Issues

Saving Passwords

This is an awesome tool, thank you for building it.

Is there a way to get macos to save the password?

At the moment I seem to have to enter the password every time the computer wakes from sleep.

Configuration groupings

Thanks for this great utility, I'm about to fork it and attempt to add some grouping functionality to it, but I wanted to pick your brain and see if you knew what would be needed in order to do so.

In the Network preferences UI we have the ability to add multiple configurations to the same VPN connection as seen in the screenshot below, any idea how to replicate this functionality via scutil? any help I can get would be wonderful

Thanks

otherviews_and_network

Creating a cisco vpn fails

Hi,
I've tried to create a cisco vpn just using the parameters in the example to see how the things worked and it fails.
I'm using macOS Big Sur.

sudo macosvpn create --cisco Atlantic --endpoint example.com --username Alice --password p4ssw0rd --sharedsecret s3same -d
Password:
Processing argument slice: ["--cisco", "Atlantic", "--endpoint", "example.com", "--username", "Alice", "--password", "p4ssw0rd", "--sharedsecret", "s3same"]
Parsing arguments for service...
Parsing succeeded, 0 arguments unaccounted for.
You did not pass in any invalid arguments
Converting arguments to Cisco ServiceConfig...
Conversion succeeded.

You wish to create one or more VPN service(s)
Obtaining Authorization...
Authorization successfully obtained
Gained superhuman rights.
Initializing IPSec Interface on top of IPv4
Instantiating interface references for service `Atlantic`...
Adding default protocols (DNS, etc.) to service `Atlantic`...
Assigning name to service `Atlantic`...
And we also would like to know the internal ID of this service
Look at my service ID: 1DDDD65D-F11C-4CFC-A2CA-1A2777F5A4CA
Reloading top Interface...
Configuring Cisco IPSec Service
Assembling ciscoConfig configuration dictionary...
ciscoConfig ready: [RemoteAddress: Optional(example.com), SharedSecret: Optional(1DDDD65D-F11C-4CFC-A2CA-1A2777F5A4CA.SS), XAuthPasswordEncryption: Optional(Keychain), AuthenticationMethod: Optional(SharedSecret), SharedSecretEncryption: Optional(Keychain), XAuthPassword: Optional(1DDDD65D-F11C-4CFC-A2CA-1A2777F5A4CA.XAUTH), XAuthName: Optional(Alice)]
Successfully configured Cisco IPSec interface of service Atlantic
Fetching IPv4 protocol of service Atlantic...
Configuring IPv4 protocol of service Atlantic...
Assembling ciscoIPv4Config configuration dictionary...
ciscoIPv4Config ready: [ConfigMethod: Optional(Automatic)]
Fetching current network service set...
Fetching all services from network set...
Ignoring irrelevant Service Bluetooth PAN
Ignoring irrelevant Service USB 10/100/1000 LAN
Ignoring irrelevant Service Wi-Fi
Ignoring irrelevant Service Thunderbolt Bridge
Adding Service <SCNetworkService 0x7feacb904100 [0x7fff80063f50]> {id = 1DDDD65D-F11C-4CFC-A2CA-1A2777F5A4CA, prefs = 0x7feac9404e00, name = Atlantic} to networkSet <SCNetworkSet 0x7feacb804ff0 [0x7fff80063f50]> {id = DADA2C30-51F0-4245-980F-1492132A9670, prefs = 0x7feac9404e00, new}...
Added successfully to networkSet...
Preparing to add Keychain items for service Atlantic...
Creating XAuth Keychain Item...
Creating Cisco IPSec XAuth Keychain Item with ID 1DDDD65D-F11C-4CFC-A2CA-1A2777F5A4CA.XAUTH
Creating System Keychain for Atlantic with service 1DDDD65D-F11C-4CFC-A2CA-1A2777F5A4CA.XAUTH and account  and description IPSec XAuth Password and password? true
Retrieving System Keychain...
Successfully retrieved System Keychain
Unlocking System Keychain...
Succeeded unlocking System Keychain
Created empty Keychain access object
Creating Keychain item failed: Optional(The specified attribute does not exist.)

segmentation fault

Self compile and execute has error:

Processing argument slice: ["--l2tp", "ovpn", "--endpoint", "xx.xx.xx.xxx", "--username", "vpnuser", "--password", "JJJJJJJJJ", "--sharedsecret", "3EG2"]
Parsing arguments for service...
Parsing succeeded, 0 arguments unaccounted for.
You did not pass in any invalid arguments
Converting arguments to L2TP ServiceConfig...
Conversion succeeded.
You wish to create one or more VPN service(s)
Obtaining Authorization...
Authorization successfully obtained
Gained superhuman rights.
Initializing L2TP Interface on top of IPv4...
[1] 70937 segmentation fault sudo ./macosvpn create --l2tp ...

But the version from brew that's ok.

Searchdomain not not accesible when using "Send all traffic over VPN connection"

When "send all traffic over VPN connection" (the default) is selected and although it is shown to be selected in the UI.
While using nslookup, the searchdomain is not appended to the request. Toggling "Send all traffic over VPN connection", and restarting the VPN connection resolves this behavior.

This is happening on Catalina, Big Sur, Monterey.

image

Fails to build with Xcode 9 on macOS 10.13

** BUILD FAILED **
The following build commands failed:
	CompileC build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/DDOSLogger.o macosvpn/Vendor/CocoaLumberjack/DDOSLogger.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Full logs there: https://gist.github.com/4dd9dd05a6147e9608c1ea548379e365

/tmp/macosvpn-20170924-40656-41s3ia/macosvpn-0.3.2/macosvpn/Vendor/CocoaLumberjack/DDOSLogger.m:58:17: error: static_assert failed "format argument mus
t be a string constant"
                os_log_error(OS_LOG_DEFAULT, msg);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'os' imported from /tmp/macosvpn-20170924-40656-41s3ia/macosvpn-0.3.2/macosvpn/Vendor/CocoaLumberjack/DDOSLogger.m:17:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/os/log.h:319:9: note: expanded from mac
ro 'os_log_error'
        os_log_with_type(log, OS_LOG_TYPE_ERROR, format, ##__VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/os/log.h:475:5: note: expanded from mac
ro 'os_log_with_type'
    _Static_assert(__builtin_constant_p(format), "format argument must be a string constant"); \
    ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/macosvpn-20170924-40656-41s3ia/macosvpn-0.3.2/macosvpn/Vendor/CocoaLumberjack/DDOSLogger.m:62:17: error: static_assert failed "format argument mus
t be a string constant"
                os_log_info(OS_LOG_DEFAULT, msg);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'os' imported from /tmp/macosvpn-20170924-40656-41s3ia/macosvpn-0.3.2/macosvpn/Vendor/CocoaLumberjack/DDOSLogger.m:17:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/os/log.h:247:9: note: expanded from mac
ro 'os_log_info'
        os_log_with_type(log, OS_LOG_TYPE_INFO, format, ##__VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/os/log.h:475:5: note: expanded from mac
ro 'os_log_with_type'
    _Static_assert(__builtin_constant_p(format), "format argument must be a string constant"); \
    ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/macosvpn-20170924-40656-41s3ia/macosvpn-0.3.2/macosvpn/Vendor/CocoaLumberjack/DDOSLogger.m:67:17: error: static_assert failed "format argument mus
t be a string constant"
                os_log_debug(OS_LOG_DEFAULT, msg);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'os' imported from /tmp/macosvpn-20170924-40656-41s3ia/macosvpn-0.3.2/macosvpn/Vendor/CocoaLumberjack/DDOSLogger.m:17:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/os/log.h:277:9: note: expanded from mac
ro 'os_log_debug'
        os_log_with_type(log, OS_LOG_TYPE_DEBUG, format, ##__VA_ARGS__)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/os/log.h:475:5: note: expanded from macro 'os_log_with_type'
    _Static_assert(__builtin_constant_p(format), "format argument must be a string constant"); \
    ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.

homebrew build failure for version 1.0.0

Hey,

first of all thanks for this nice project.

We would like to try the new version early next year and I updated the homebrew formula but the build failed.

I'm sorry I can't help here but hopefully you can ;)

Thanks in advance and Merry Christmas ;)

Debug the project

Hi,

We run executable from command-line to create VPN. We would like to debug the executable.
Please tell how to debug in Xcode.

Puts endpoint value insted of username to VPN connection

See VPNArguments.m line 86
config.username = [self extractArgumentForSignature:self.endpointSig withFallbackSignature:self.defaultUsernameSig atIndex:i];

I think instead of self.endpointSig there should be self.usernameSig

Delete all VPN entries at once

I miss the feature to remove all VPN entries at once.
Can you please add that function?

For ex.
macosvpn delete --all
macosvpn delete -a

or whatever...

Thanks in advance

Catalina and Big Sur, 1.0.3, VPN configuration works but is not visible

So I'm seeing an issue with new machines where one can successfully install macosvpn (at least the files appear where they are supposed to and the command appears to work). I install a configuration and it never appears in Network control panel, but it will appear (only in the menu bar dropdown, not in the Network pane) if I start a new VPN interface and check the box for "Show VPN status in menu bar." Sometimes rerunning the creation script several times will work, sometimes nothing except the menu bar item workaround.

install:

#!/bin/bash
sudo sh -c "curl -L https://github.com/halo/macosvpn/releases/download/1.0.3/macosvpn > /usr/local/bin/macosvpn"
sudo chmod +x /usr/local/bin/macosvpn
echo "macosvpn command line installed"
exit 0\

and I configure with this:

/usr/local/bin/macosvpn create --force --cisco CLIENT_VPN --endpoint [ip address] --username "[your full name]" --password "[your VPN password]" --sharedsecret [sharedsecret]

am I doing it wrong?

Would the code sample work on iOS [QUESTION]

Hello! I see that your application supports L2TP/IPSEC configurations. Would the solution you have provided work to implement the same on iOS? As you might know iOS only provides solutions to only 2 protocols for VPN, that being IPSEC and IKEV2. I want to create a mobile application that would allow users to easily add a L2TP/IPSEC configuration, and connect to it through the application, by just selecting one of the servers provided in the app.

I researched a lot about this, and the only way this is possible is to develop a custom Protocol for L2TP/IPSEC and extending NetworkExtension and using NETunnelProvider and unfortunately I have no idea how to do this, and there are not enough resources to be found to help me learn to accomplish this. Then I stumbled across your project and I found that you support L2TP/IPSEC configurations on MacOS was wondering if the same would work for iOS.

Homebrew formula?

Just come across your tool - which is exactly what I am looking for. It seems to not be available via Homebrew - is there a reason for that & if not would you have any objection to me writing a formula for it?

Issue with Password and SharedSecretKey Store in SYSTEM Keychain

Hello,

I am using your VPNKeychain Class to Store Password and SharedSecretKey in SYSTEM Keychain but to store password and sharedsecretkey in System Keychain we need root access. Currently it's showing "Write Permission Error" in my MAC Application.

Can you guide me how can I use your VPNKeychain Class with root access.

macosvpn and 10.12 Beta

Dear Halo,

I have been using macosvpn with great success to setup Cisco IPSec VPN services. However I am currently testing macOS 10.12 and when I try and use macosvpn to create a Cisco IPSec Service (--cisco) the command produces a Segmentation fault: 11 error and the service is NOT created. However it can create non-Cisco VPN services without the Segmentation fault: 11.

Are you aware of this issue and do you plan to update the app to work with 10.12?

Thanks very much for your help.

Kind regards,

Gary.

Write permission error when app is trying to add keychains

When macosvpnis trying to add keychains in order to store Password and Shared secret in VPNKeychain.m line 115, then in line 120 we have Creating Keychain item failed: write permissions error
When i run macosvpn with sudo all working just great - no errors and VPN connection with keychains are creating.
I know app requiments say that in order to run macosvpn user should have administrator privileges, but is it possible to make app work from unprivileged user's accounts, e.g. app is asking user password (like sudo does) in order to add keychains.

Mac OSX 10.9.5 Darwin/13.4.0

Connect VPN from this tool?

Hi,

I tested your code and it works fine to create a VPN interface in network settings. Can I also use same executable to establish a connection to VPN by passing some parameters?

--Laxman

Failure to build with Xcode 11

==> xcodebuild SYMROOT=build
Build settings from command line:
    SYMROOT = build

note: Using new build system
note: Planning build
note: Constructing build description
error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'macosvpn' from project 'macosvpn')

precompiled macosvpn fails on 10.13

Hi ,

on High Sierra your precompiled binary does not seem to work

$sudo /usr/local/bin/macosvpn --version 
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /usr/local/bin/macosvpn
Reason: image not found
Abort trap: 6

and trying to build an own version on High Sierra fails as well.

$ brew install macosvpn
macosvpn: A full installation of Xcode.app 11.1 is required to compile
this software. Installing just the Command Line Tools is not sufficient.

Xcode 11.1 cannot be installed on macOS 10.13.
You must upgrade your version of macOS.
Error: An unsatisfied requirement failed this build.

VPN setup requires sudo

@halo
Without sudo, can I create VPN in MacOS?
It seems like it is requiring sudo permission to write to System Keychain which is not necessary for network VPN setup.
What should I do to use this without sudo permission?

Password not set on OSX 10.11

Hi

I was testing the latest Sierra branch cefc893 on 10.11 and it doesn't set the password for L2TP/IpSec connections. My idea was to get the latest commit so it would work on 10.9 to 10.12(beta).

It seems that the service = ... change in VPNKeychange.m is the problem

+ (int) createPasswordKeyChainItem:(NSString*)label forService:(NSString*)service withAccount:(NSString*)account andPassword:(NSString*)password {
  service = [NSString stringWithFormat:@"%@.XAUTH", service];

I'm not very familiar with the internals of the keychain data. Did the format change in Sierra?
Looking at the Keychain app, the passwords are there, but are shown with type "PPP password" and when connecting the VPN it asks for a password.
If I comment that line out the type becomes "VPN password" and it works. I don't have 10.12 to test with it unfortunately.

Best
Vladimir

Barred applications from using VPN ? Or bypass vpn usage , so that some of application we want can use it.

Hello,

Great work. Really helped a lot.
I able to successfully create vpn tunnel from your code and i able to connect to this service using
scutill command.

Now what i need is , i want to re-route traffic. So i can barred some applications from using VPN through my app.
I read about Network extension custom protocol , there we can do something like that.
But as we are not using it , so it will not help .

Is it possible ? If it is how can i do it ? Any suggestions.

Brew file install error

When trying to use brew "macosvpn" in my brewfile i get an error. I can install by using brew install macosvpn, but cant figure out why I get a "Error: Invalid Brewfile: undefined local variable or method `“macsosvpn”' Any thoughts?

0.3.4 build fails on El Capitan

==> xcodebuild SYMROOT=build
Build settings from command line:
    SYMROOT = build

2018-01-01 04:19:18.139 xcodebuild[3276:10743] Failed to locate a valid instance of CoreSimulatorService in the bootstrap.  Adding it now.
2018-01-01 04:19:18.140 xcodebuild[3276:10743] Failed to load CoreSimulatorService.  Access to simulator services will not be available.  Error=Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={NSLocalizedDescription=Unable to lookup com.apple.CoreSimulator.CoreSimulatorService in the bootstrap.  This can happen if running with a sandbox profile.  When running with a sandbox profile, /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc must be owned by root, not group writable, and not world writable.  See <rdar://problem/22142915>.}
2018-01-01 04:19:18.140 xcodebuild[3276:10746] CoreSimulatorService connection became invalid.  Simulator services will no longer be available.
2018-01-01 04:19:18.141 xcodebuild[3276:10743]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-11753/IDEiOSSupportCore/DVTiPhoneSimulatorLocator.m:105
Details:  [SimServiceContext defaultDeviceSetWithError:] returned nil (Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedFailureReason=Failed to subscribe to notifications from CoreSimulatorService., NSLocalizedDescription=Failed to initialize simulator device set., NSUnderlyingError=0x7ffd4624b110 {Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={NSLocalizedDescription=Error returned in reply to notification request: Connection invalid}}}). Simulator device support disabled.
Object:   <DVTiPhoneSimulatorLocator: 0x7ffd43e7e9c0>
Method:   -startLocating
Thread:   <NSThread: 0x7ffd41518a40>{number = 3, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
2018-01-01 04:19:18.142 xcodebuild[3276:10745] Failed to locate a valid instance of CoreSimulatorService in the bootstrap.  Adding it now.
2018-01-01 04:19:18.143 xcodebuild[3276:10745] Failed to load CoreSimulatorService.  Access to simulator services will not be available.  Error=Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={NSLocalizedDescription=Unable to lookup com.apple.CoreSimulator.CoreSimulatorService in the bootstrap.  This can happen if running with a sandbox profile.  When running with a sandbox profile, /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc must be owned by root, not group writable, and not world writable.  See <rdar://problem/22142915>.}
2018-01-01 04:19:18.143 xcodebuild[3276:10738] CoreSimulatorService connection became invalid.  Simulator services will no longer be available.
=== BUILD TARGET macosvpn OF PROJECT macosvpn WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies

Write auxiliary files
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/swift-overrides.hmap
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-own-target-headers.hmap
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn.hmap
/bin/mkdir -p /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn.LinkFileList
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn-OutputFileMap.json
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-all-non-framework-target-headers.hmap
/bin/mkdir -p /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/SharedPrecompiledHeaders/macosvpn-Prefix-ewfsgrnshsialocyemafavpvdusc
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/SharedPrecompiledHeaders/macosvpn-Prefix-ewfsgrnshsialocyemafavpvdusc/macosvpn-Prefix.pch.pch.hash-criteria
/bin/mkdir -p /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/SharedPrecompiledHeaders/macosvpn-Prefix-aptyfoysyfsgsigbklgmurfbckzk
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/SharedPrecompiledHeaders/macosvpn-Prefix-aptyfoysyfsgsigbklgmurfbckzk/macosvpn-Prefix.pch.pch.hash-criteria
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-generated-files.hmap
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-all-target-headers.hmap
write-file /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-project-headers.hmap

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    cd /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4
    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
    export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name macosvpn -O -whole-module-optimization -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -target x86_64-apple-macosx10.9 -g -Xfrontend -serialize-debugging-options -I /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/Release -F /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/Release -F /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor -c -num-threads 8 /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/StyleParameter.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Wrap.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNColor.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNCommand.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNHelp.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Color\ ·\ Named.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNController.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Color.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/ECMA\ 48.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNAuthorizations.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNLogger.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Color\ ·\ EightBit.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNExitCode.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNCommandType.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNCFArray+Sequence.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNLogFormatter.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNServiceCreator.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/Optional+String.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/CocoaLumberjack/CocoaLumberjack.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNServiceType.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNServiceRemover.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/main.swift -output-file-map /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn.swiftmodule -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/swift-overrides.hmap -Xcc -iquote -Xcc /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-generated-files.hmap -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-own-target-headers.hmap -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-all-target-headers.hmap -Xcc -iquote -Xcc /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-project-headers.hmap -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/Release/include -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/DerivedSources/x86_64 -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/DerivedSources -emit-objc-header -emit-objc-header-path /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn-Swift.h -import-objc-header /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/macosvpn-Bridging-Header.h -Xcc -working-directory/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4

CompileSwift normal x86_64
    cd /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/StyleParameter.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Wrap.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNColor.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNCommand.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNHelp.swift "/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Color · Named.swift" /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNController.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Color.swift "/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/ECMA 48.swift" /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNAuthorizations.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNLogger.swift "/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/PrettyColors/Color · EightBit.swift" /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNExitCode.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNCommandType.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNCFArray+Sequence.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNLogFormatter.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNServiceCreator.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/Optional+String.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor/CocoaLumberjack/CocoaLumberjack.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNServiceType.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNServiceRemover.swift /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/main.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/Release -F /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/Release -F /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Vendor -g -import-objc-header /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/macosvpn-Bridging-Header.h -serialize-debugging-options -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/swift-overrides.hmap -Xcc -iquote -Xcc /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-generated-files.hmap -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-own-target-headers.hmap -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-all-target-headers.hmap -Xcc -iquote -Xcc /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/macosvpn-project-headers.hmap -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/Release/include -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/DerivedSources/x86_64 -Xcc -I/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/DerivedSources -Xcc -working-directory/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4 -emit-module-doc-path /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn.swiftdoc -O -module-name macosvpn -emit-module-path /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn.swiftmodule -emit-objc-header-path /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/macosvpn-Swift.h -serialize-diagnostics-path /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/StyleParameter.dia -emit-dependencies-path /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/StyleParameter.d -num-threads 8 -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/StyleParameter.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/Wrap.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNColor.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNCommand.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNHelp.o -o "/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/Color · Named.o" -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNController.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/Color.o -o "/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/ECMA 48.o" -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNAuthorizations.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNLogger.o -o "/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/Color · EightBit.o" -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNExitCode.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNCommandType.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNCFArray+Sequence.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNLogFormatter.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNServiceCreator.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/Optional+String.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/CocoaLumberjack.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNServiceType.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/VPNServiceRemover.o -o /tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/build/macosvpn.build/Release/macosvpn.build/Objects-normal/x86_64/main.o
/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNController.swift:46:31: error: binary operator '==' cannot be applied to operands of type 'UInt' and 'UInt8'
    if VPNArguments.command() == VPNCommandType.Create {
       ~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~
/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNController.swift:46:31: note: overloads for '==' exist with these partially matching parameter lists: (UInt8, UInt8), (UInt, UInt)
    if VPNArguments.command() == VPNCommandType.Create {
                              ^
/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNController.swift:50:36: error: binary operator '==' cannot be applied to operands of type 'UInt' and 'UInt8'
    else if VPNArguments.command() == VPNCommandType.Delete {
            ~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~
/tmp/macosvpn-20180101-3267-15hlo4d/macosvpn-0.3.4/macosvpn/Classes/VPNController.swift:50:36: note: overloads for '==' exist with these partially matching parameter lists: (UInt8, UInt8), (UInt, UInt)
    else if VPNArguments.command() == VPNCommandType.Delete {
                                   ^

** BUILD FAILED **


The following build commands failed:
	CompileSwift normal x86_64
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)

0.1.1 doesn't seem to add anything at all

  • cisco VPN
  • 0.1.0 worked but doesn't support adding groupname

It provides warnings fine if you miss out settings:
Warning: You did not provide a group name for service <abc>

Build problems with Xcode 8.3.2

I'm seeing a number of build issues with Xcode 8.3.2. First, the command line xcodebuild fails because the Swift code needs to be updated.

Next, both Wrap.swift and VPNHelp.swift fail to compile with the following errors:

/Users/acronce/Sources/third_party/macosvpn/macosvpn/macosvpn/Vendor/PrettyColors/Wrap.swift:215:50: 'Distance' is not a member type of 'Color.Wrap.Index' (aka 'Int')

/Users/acronce/Sources/third_party/macosvpn/macosvpn/macosvpn/Vendor/PrettyColors/Wrap.swift:192:1: Type 'Color.Wrap' does not conform to protocol '_MutableIndexable'

/Users/acronce/Sources/third_party/macosvpn/macosvpn/macosvpn/Vendor/PrettyColors/Wrap.swift:192:1: Type 'Color.Wrap' does not conform to protocol '_IndexableBase'

Enable Session Options

Not sure if I missed this somewhere or if this would be considered a feature request, but is it possible to enable both Disconnect options when creating the VPN configuration?

image

IKEv2 support?

Very cool utility, although I wish scutil would just do its dang job. :-)

Would it be possible to add IKEv2 support to this project?

GUI for Mac?

It would be great to have an user friendly GUI. Any plans on that in the near future?

Failing to create service in MacOS Ventura

Debug output tail

Adding Service <SCNetworkService 0x6000004d0d00 [0x7ff85d38ce90]> {id = 8C3A4189-C2C9-4609-AE5E-62CDF0A5BC96, prefs = 0x7f7d46004590, name = <SERVICE>} to networkSet <SCNetworkSet 0x600001fd4a80 [0x7ff85d38ce90]> {id = 982B37A5-4F27-4D87-95EA-D7E24A1839DF, prefs = 0x7f7d46004590, new}...
Added successfully to networkSet...
Preparing to add Keychain items for service <SERVICE>...
Creating PPP Keychain Item...
Creating Password Keychain Item with ID 8C3A4189-C2C9-4609-AE5E-62CDF0A5BC96
Creating System Keychain for <SERVICE> with service 8C3A4189-C2C9-4609-AE5E-62CDF0A5BC96 and account   and description PPP Password and password? true
Retrieving System Keychain...
Successfully retrieved System Keychain
Unlocking System Keychain...
Succeeded unlocking System Keychain
Could not create trusted application: Optional(UNIX[No such file or directory])

Also hi.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.