Post

Replies

Boosts

Views

Activity

How get certificate from CA - which would be in trust store of iPhone
My app have part of code where I am create VPN profile but can't establish connection because I am install file .p12, but not a .cer. How I can get certificate from CA for my VPN, describe please full process of obtaining this certificate, and how much cost this operation? I am don't find clearly answer of this question and can't understand how it will be occur.
1
0
328
Dec ’20
Process automation for installing .cer and .p12 files for VPN
My app create VPN profile programmatically for user but connection fail each time. I can solved this problem doing next: I am create file .mobileconfig using AppleConfigurator and create "Certificate 2 Payloads Configured" inside this file I put file .p12 and set password for this file and file .cer. When user install this profile only after this operation VPN connection would be establish. Inside app I am use file .p12 for NEVPNManager( use NEVPNProtocolIKEv2 ). How I can install file .cer programmatically inside app or need install something else? Which advice are you can give in this situation?
1
0
914
Dec ’20
VPN connection each time fails without .mobileconfig
I am create VPN profile programmatically using NEVPNManager all looking good. When I am try connecting to VPN each time, connection fails but if I install to system, file .mobileconfig and then try connect all work good. Also I am try by hand download certificate from (developer.apple.com - > Certificates, Identifiers & Profiles) and then install is, all work good. Inside project I did put file .p12 with certificate and load it using "Bundle.main.url". It's problem appears because app can't install certificate to the iphone system or? I am need that when user install app it can use vpn immediately, without downloading .mobileconfig and then install it to system. How solved this problem ? Only way which exist it buy certificate from CA which will be inside system or I am just did something wrong? I am don't understand where mistakes and how solve this problem)
1
0
413
Dec ’20
Detect player of iframe inside WKWebKit
Hello. If I am load web site with movies using WKWebView and then press on player in website content will be open in some player above WKWebView, It is possible detect when this player is open or close? Or if it's impossible I can detect when user press on player and then catch iframe of web element like that <iframe src="URL of player" width="560" height="315" frameborder="0" allowfullscreen></iframe> and then open inside UIView or something else above WKWebView. For clarity I am attach url with image of this player https://ibb.co/y69tQ6c Regards, Ihor.
1
0
1.1k
Nov ’20
Only ONE user can connected to VPN from device
Hello. Few week ago I am try create VPN which based on IKEv2 protocol, I am solved this problem and vpn work correct. But when I am try test VPN on few real devices I am get next problem: VPN can use only one user, I am good connected to vpn from my iphone which I am use for test whole time but on other devices I can't connected to vpn, What is the problem. This is my question when I am did try create VPN (all work fine)- https://developer.apple.com/forums/thread/662799 In project I am create Class where I am configure VPN and put into project file .p12. How I can solved this problem, because I am don't know where I am get mistake) I am should try solved this problem on iOS side or server side? This is example how I am configure VPN profile - https://gist.github.com/IhorYachmenov/fb63fd19f30541780950b6670e8a2865 Regards, Ihor.
2
0
447
Oct ’20
How I can change my first name and last name to real in Xcode account and Developer Forum
Hello. Can't find way how change my name to real, In the past I am register that account for testing iOS and now I am create app for iOS, how I can change my last name and first name on xcode account. Inside Apple ID I am did write correct data but when I am login with this account into xcode and developer forum, I am saw data from past.
0
0
416
Oct ’20
How to update UI inside URLSession?
Hello I am try hide check if website is available use URLSession then, get info about availability and hide activity indicator and use "performSegue", but it don't work when I am was obtain data from URLSession, I am use: DispatchQueue.global DispatchQueue.main.async OperationQueue.main.addOperation but it don't help what I am doing wrong? This is example of my code: URLSession. class ServiceWebSiteAvailability: NSObject {   static let shared = ServiceWebSiteAvailability()   var state: Bool?       func available(LinkOfWebsite link: String, completion: @escaping (Error?) -&gt; ()) {           if let url = URL(string: link) {      var request = URLRequest(url: url)      request.httpMethod = "HEAD"       DispatchQueue.main.async {                      URLSession(configuration: .default)       .dataTask(with: request) { (_, response, error) -&gt; Void in                    guard error == nil else {           print("Error:", error ?? "")           self.state = false           return completion(nil)         }         guard (response as? HTTPURLResponse)?           .statusCode == 200 else {                       print("down")           self.state = false           return completion(nil)         }                   self.state = true         print("up")         completion(nil)       }       .resume()       }     }             } } Check site url:    func openLinkInsideWKWebKit(url: String) {     createSpinnerView()     ServiceWebSiteAvailability.shared.available(LinkOfWebsite: url) { (error) in       guard let state = ServiceWebSiteAvailability.shared.state else { return }       if (error != nil) {         print("Site accesibility is - \(state)") /* This code block below don't work         if (state == true || state == false) {           self.performSegue(withIdentifier: "main", sender: nil)           self.child.willMove(toParent: nil)       self.child.view.removeFromSuperview()       self.child.removeFromParent()         }                 } else {         print("Site accesibility is - \(state)")       }/     }   } What I am doing wrong?
2
0
1.8k
Oct ’20
How I can display Image .svg into UICollectionView Cell?
Hello. I am try display .svg image into my app for some collection view cell but can't display their, I am put UIImageView into collection view cell and load .svg from assets but I see pixels, after searching I decide that UIImageView don't support .svg image. How I can load Image .svg into UICollectionView Cell? I am should use some external library or convert .svg to pdf and then load image? Regards, Ihor.
1
0
1.7k
Oct ’20
Building VPN, what to choose?
Hello Few week ago I am was began create vpn for ios. I am was try create vpn use NEVPNManager with IKEv2 protocol but I am have trouble with certificate in iOS( because need certificate from CA ). Second which I am try was be create VPN use NETunnelProvider bu I am also can't create vpn. Also I am use information from other sources, but each time I am failed. Last time I am use AlgoVPN on my server with ubuntu and programmatically create vpn profile on ios, but I can't use this auth method without certificate and it's trouble for me. How I can create vpn only with login and password authentication method without any certificate? My app give access to blocked site in my country and I am need programmatically enable and disable vpn client. Now I am want use WireGuard but I don't know can I create or not vpn client. I am don't have many experince with these complex tasks, if you know how create vpn without pain please give me advice, should I am use this way or some else. Regards, Ihor.
16
0
2.4k
Oct ’20
NEVPNManager or NEPacketTunnelProvider for VPN.
Hello. I am try create VPN using NEVPNManager, I am use Certificate authentication and IKEv2 protocol. When vpn was installed on iPhone and I am try connect to server, I get this error: Connection 8: received failure notification nw_flow_add_write_request [C8.1 (Ip&Port) failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] cannot accept write requests nw_write_request_report [C8] Send failed with error "Socket is not connected" Connection 5: received failure notification only FIRST time after installation, then I am nothing get from VPN. In this question https://developer.apple.com/forums/thread/84679 If you want to continue down the NEVPNManager path you will have to get a trusted CA to issue you a certificate for your VPN server answer by eskimo. I am decide create VPN use NEPacketTunnelProvider but I am don't understand completely all what should I am expected when I will be try that. How more lot of work will be there? I can create VPN with IKEv2 for users without certificate CA trusted? Or good reason will be change authentication method from certificate to login and password for IKEv2 or change protocol on IPsec and use login, pass & secret to authentication method? Regards, Ihor.
3
0
897
Oct ’20
Can't establish VPN connection, VPN profile not verify certificate .p12.
Hello. I am trying create VPN programmatically, because I am need enable and disable it from App but I have some problem when do it. First when I am download file ( client.mobileconfig ) and then install to iPhone vpn works good but I can't control state of VPN. I am was examine this file, using program "Apple Configurator 2" and create profile of vpn programmatically, but when I am want connect to VPN, I am saw this error ONLY first time then I am don't see any errors: Connection 8: received failure notification nwflowaddwriterequest [C8.1 (Ip&Port) failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] cannot accept write requests nwwriterequest_report [C8] Send failed with error "Socket is not connected" Connection 5: received failure notification Connection 5: failed to connect 1:53, reason -1 Connection 5: encountered error(1:53) Connection 4: received failure notification Connection 4: failed to connect 1:53, reason -1 Connection 4: encountered error(1:53) Connection 1: received failure notification Connection 1: failed to connect 1:53, reason -1 Connection 1: encountered error(1:53) Connection 2: received failure notification Connection 2: failed to connect 1:53, reason -1 Connection 2: encountered error(1:53) Connection 3: received failure notification Connection 3: failed to connect 1:53, reason -1 Connection 3: encountered error(1:53) Connection 6: received failure notification Connection 6: failed to connect 1:53, reason -1 Connection 6: encountered error(1:53) This Is My code:  let vpnManager = NEVPNManager.shared()       func initVPNTunnelProviderManager() {     print("CALL LOAD TO PREFERENCES...")     self.vpnManager.loadFromPreferences { (error) -> Void in       if((error) != nil) {         print("VPN Preferences error: 1 - \(error)")       } else {         let IKEv2Protocol = NEVPNProtocolIKEv2()                   IKEv2Protocol.authenticationMethod = .certificate         IKEv2Protocol.serverAddress = self.vpnServerAddress         IKEv2Protocol.remoteIdentifier = self.vpnRemoteIdentifier         IKEv2Protocol.localIdentifier = self.vpnLocalIdentifier         IKEv2Protocol.useExtendedAuthentication = false         IKEv2Protocol.ikeSecurityAssociationParameters.encryptionAlgorithm = .algorithmAES256GCM         IKEv2Protocol.ikeSecurityAssociationParameters.diffieHellmanGroup = .group20         IKEv2Protocol.ikeSecurityAssociationParameters.integrityAlgorithm = .SHA512         IKEv2Protocol.ikeSecurityAssociationParameters.lifetimeMinutes = 1440         IKEv2Protocol.childSecurityAssociationParameters.encryptionAlgorithm = .algorithmAES256GCM         IKEv2Protocol.childSecurityAssociationParameters.diffieHellmanGroup = .group20         IKEv2Protocol.childSecurityAssociationParameters.integrityAlgorithm = .SHA512         IKEv2Protocol.childSecurityAssociationParameters.lifetimeMinutes = 1440         IKEv2Protocol.deadPeerDetectionRate = .medium         IKEv2Protocol.disableRedirect = true         IKEv2Protocol.disableMOBIKE = false         IKEv2Protocol.enableRevocationCheck = false         IKEv2Protocol.enablePFS = true         IKEv2Protocol.useConfigurationAttributeInternalIPSubnet = false         IKEv2Protocol.serverCertificateIssuerCommonName = self.vpnServerCertificateIssuerCommonName         IKEv2Protocol.disconnectOnSleep = false         IKEv2Protocol.certificateType = .ECDSA384         IKEv2Protocol.identityDataPassword = self.p12Password         IKEv2Protocol.identityData = self.dataFromFile() as Data         self.vpnManager.protocolConfiguration = IKEv2Protocol         self.vpnManager.localizedDescription = "Safe Login Configuration"         self.vpnManager.isEnabled = true         self.vpnManager.isOnDemandEnabled = true         //Set rules         var rules = [NEOnDemandRule]()         let rule = NEOnDemandRuleConnect()         rule.interfaceTypeMatch = .any         rules.append(rule)         //SAVE TO PREFERENCES...         self.vpnManager.saveToPreferences(...)       }     } //END OF .loadFromPreferences //   }       func dataFromFile() -> NSData{     let rootCertPath = Bundle.main.path(forResource: "client", ofType: "p12")     let certficiateData = NSData(contentsOfFile: rootCertPath!)     return certficiateData!   } If I am change this line of code: IKEv2Protocol.identityDataPassword = self.p12Password IKEv2Protocol.identityData = self.dataFromFile() as Data on this verifying method: IKEv2Protocol.identityReference = self.identityReference() private func identityReference() -> Data {     let rootCertPath = Bundle.main.path(forResource: "client", ofType: "p12")     let certficiateData = NSData(contentsOfFile: rootCertPath!)           var importResult: CFArray? = nil     let err = SecPKCS12Import(certficiateData! as NSData, [       kSecImportExportPassphrase: p12Password     ] as NSDictionary, &importResult)     guard err == errSecSuccess else { fatalError() }     let importArray = importResult! as! [[String:Any]]     let identity = importArray[0][kSecImportItemIdentity as String]! as! SecIdentity     var copyResult: CFTypeRef? = nil     let err2 = SecItemCopyMatching([       kSecValueRef: identity,       kSecReturnPersistentRef: true     ] as NSDictionary, &copyResult)     guard err2 == errSecSuccess else { fatalError() } //&#9;Here I am see fatal error here     return copyResult! as! Data   } I am obtain fatal error and I am don't understand where I did mistake. What is my problem? I can't find information about this mistakes. If need I am attach "client.mobileconfig" file.
1
0
1k
Sep ’20
VPN manipulation use vpn.mobileconfig
Hello. I am try install vpn use file .mobileconfig, and vpn configuration work well but I am need programmatically from app enable and disable VPN, I am use IKEv2 protocol. Exist way install this file from my app of create this file inside app then install this profile programmatically, and get opportunity programmatically enable and disable VPN or if I am want do this I am create VPN profile programmatically like this? https://stackoverflow.com/questions/24970280/connect-to-vpn-programmatically-in-ios-8 Regards, Ihor.
2
0
768
Sep ’20
PAC script for mobile network
Hello. I am try create proxying web site through WKWebKit, I am find answer that it is possible only use PAC script (https://developer.apple.com/forums/thread/660636). Tell me please, if I am create this PAC Script, it will be work if user will be use Mobile Network Connection (such as Vodafone .....), or it is will be work only for Wi-Fi connections? I don't work with pac script before and don't find unambiguous answer about that.
2
0
1.1k
Sep ’20
WKWebview proxying HTTP Request
Hello, We have application which should pass traffic through https private proxy server if it needed, but I am find info that is impossible with WKWebView, only if i want send traffic we should use VPN. Is there a way to send traffic trough proxy use WKWebView. From this link I am sure that is impossible: https://stackoverflow.com/questions/41068675/http-proxy-support-with-wkwebview/41268348#41268348 https://stackoverflow.com/questions/55482380/swift-4-5-setting-adding-proxy-to-wkwebview?noredirect=1&lq=1 https://developer.apple.com/forums/thread/110312#337642 https://github.com/react-native-community/react-native-webview/issues/115 https://stackoverflow.com/questions/24208229/wkwebview-and-nsurlprotocol-not-working But in this link I saw a chance create this feature: https://stackoverflow.com/questions/40133512/intercept-request-with-wkwebview I am try many ways, but I can't pass traffic through proxy. Only what i can it is obtain HTML version of site through proxy. Please help me understand all picture and dispel my doubt. Regards, Ihor.
3
0
3k
Sep ’20