Post

Replies

Boosts

Views

Activity

MacOS 14 beta: DNS issue when enable VPN
Our application (VPN solution) works well on macOS 13 and this issue only occurred on macOS 14 beta. This issue is: If we connect the cable to a Mac mini’s ethernet port, and enable the VPN in our application, then the Tunnel is enabled under System Settings->Network->VPN & Filter, after that, the DNS stops resolving. If we use a “USB-C LAN” adapter to connect the cable to Mac mini’s USB-C port, this issue disappears. Only enable Wi-Fi can also avoid this issue. The confusion is what’s the difference between connect to Ethernet directly and use an adapter?
6
0
1.2k
Jul ’23
Authentication challenge delegate method won't be called if use system default proxy with credentials
Environments: MacOS 12.5.1 A squid proxy sever is set up on my local machine(127.0.0.1 with port 3128), and it requires username and password. In System Preferences->Network->Advanced, enable "Secure Web Proxy (HTTPS)", input the server 127.0.0.1 and port 3128, and do not enable "Proxy server requires password". Open a website on Chrome, an dialog will pop up to ask user to input the credentials for proxy server 127.0.0.1. I want to do the same but met this issue. As I understand, the delegate method - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler should be called after [mTask resume], but the actual behaviour is - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error was called, and the current session was terminated. Error message in console is "[] nw_http_connect_send_auth_request_block_invoke Proxy authentication failed with error -1002, cancelling connection". BTW, I tried put proxy server and port into connectionProxyDictionary, then didReceiveChallenge can be called. AM I misuse the APIs? or this is a bug in MSURLSession? Here is the codes for testing: // proxyHandler.h #import <Foundation/Foundation.h> @interface proxyHandler : NSObject <NSURLSessionTaskDelegate> - (void)submitRequest; @end //proxyHandler.m #import "proxyHandler.h" @interface proxyHandler() { NSURLSession *mSession; NSURLSessionTask *mTask; } @end @implementation proxyHandler - (void)submitRequest { NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration]; // connectionProxyDictionary is NULL, which means that tasks use the default system settings. mSession = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:nil]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.google.com"]]; mTask = [mSession dataTaskWithRequest:request]; [mTask resume]; } - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { NSLog(@"Task compelter with error domain : %s, error code: %ld\n", [error.domain UTF8String], error.code); } - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler{ NSLog(@"Task challenge: %@, isProxy: %d", challenge.protectionSpace.authenticationMethod, [challenge.protectionSpace isProxy]); } @end
2
1
1.2k
Feb ’23