Internal Server Error Xcode Continuous Integration - ios

I've successfully created a Bot and run an integration test for an iOS application hosted on a remote SVN server over HTTP. When trying to run the same test over HTTPS the test fails and I receive the error: Integration failed. Unexpected internal server error. See the integration's logs for more details. The certificate used for the SVN server is self signed and I ensured I am able to still update/commit to the server over HTTPS. After looking through the logs I can't seem to find out what the error is or how to fix it. (I would post the logs but it's like 100 pages to read through...)
Steps taken so far:
Deleted the bot and project, checked out the project over HTTPS, re-made the bot.
Ensure the correct HTTPS repository is listed both in OS X Server --> Xcode --> Repositories, and in Xcode's repository preferences. (Deleted the old repository as well)
Place the self signed certificate into the keychain's System Store and ensure it is set to Trust All.
Modified the Xcode config file xcsbuildd.plist and changed TrustSelfSignedSSLCertificates to true.
Nothing has seemed to fix it so far. If anyone can think of a fix for this issue please let me know.

I finally was able to fix this by adding to the System keychain our company's Root certificate authority and Intermediate certificate authority certs.
I used Charles (web debugging proxy) to intercept requests and responses and see what was wrong. It gave me a clue that OS X Server was struggling with certs.

Related

Your connection is not private NET::ERR_CERT_COMMON_NAME_INVALID

I am facing strange issue on chrome while debugging local ASP.NET application on chrome. I am not able to open localhost without https. With Https it's giving error: Your connection is not private NET::ERR_CERT_COMMON_NAME_INVALID.
It was working on chrome till last update & is working on firefox & IE.
There is also no option in advanced setting to skip error & visit site.
Please help.
Finally banging head on desk for two days I found this setting in chrome://flags/ to Allow invalid certificates for resources loaded from localhost.
finally no disable all certificate error, only for localhost. Adding answer for someone struggling with same issue.
We have found that the best (and only) way to override Chrome is to type the phrase thisisunsafe at the Chrome generated webpage that blocks you. Just type the text directly to the page; there will be no text entry box.
We have servers on an internal network which use SSL but which are not externally signed and this is the only way to get to them.
Just when the page loads, don't click on page and type: thisisunsafe.
Page will automatically refresh and will load the content.
You can copy this tag and add to Google Chrome shortcut to bypass this warning permanently.
--ignore-certificate-errors
Updated - March 2020: Adding the above tag to Google Chrome shortcut does not work anymore. In order to temporarily turn off or bypass this annoying warning from Google Chrome, to go chrome://flags and search for this following entry:
Allow invalid certificates for resources loaded from localhost
After that, enable the option and restart your Google Chrome browser. By doing so, you can bypass the alert as long as you want until you turn off the option.
Source: Fix Your Connection Is Not Private Error In Your Browser
There is a short explanation over at serverfault as to what changed in the RFC spec to cause this. One of the suggestions is to use or add the IP address (presumably 127.0.0.1) to the name 'localhost' for the DNS property of the self-signed cert.
If you use the dotnet core tool: dotnet dev-certs https --trust (or run the export per instructions in devcontainer.json) the localhost certificate generated will use only the name 'localhost'.
But there are other options for generating self-signed certs including Powershell. But...rather than follow the older syntax, use Example #9 as found on the New-SelfSignedCertificate docs:
New-SelfSignedCertificate -Subject "localhost" -TextExtension #("2.5.29.17={text}DNS=localhost&IPAddress=127.0.0.1&IPAddress=::1")
This appears to resolve the cert error in Chrome (96.0.4664.45). It's necessary to close and re-open Chrome after generating the new cert and incorporating it into your web project or container.
I ran into this error and my problem turned out to be Charles (it's a web debugging proxying app). I needed to install a SSL Proxy Certificate for Charles.
Go to Help menu
SSL Proxying -> Install Charles Root Certificate
Open Keychain Access and enable/allow it
If you don't use Charles then obviously this answer doesn't help you at all.
I had similar problem when I tried to use my self signed certificate and run my xhtml app in browser under https and with tomcat. What I did:
in java's RE dir (usually Program Files\Java\jre1.8.0_202\bin) there is keytool and in command line I used this:
keytool -genkey -alias example -keyalg RSA -sigalg SHA256withRSA -keysize 2048 -validity 3650 -keystore "C:\yourdir\yourkeystore.jks" -ext san=dns:localhost,dns:yourdesktophostname,ip:127.0.0.1,ip:::1
Answer questions to create certificate which is created for 10 years, SHA-2 and what Chrome needs more: san(SubjectAlternateName).
I added below lines to tomcat's server.xml (usually Program Files\Apacha Software...\conf:
<Connector port="yourportnumber" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true"
compression="on" scheme="https" secure="true"
keystoreFile="conf/yourkeystore.jks"
keystorePass="yourpassword"
SSLVerifyClient="none" SSLProtocol="TLSv1.2"/>
Restart Tomcat.
Open the localhost address in Chrome browser (https:\localhost:yourport). It will tell "Not secure" at left side of address line and https crossed out Click on it and in that window press on certificate (invalid). It opens the certificate window and press on Details tab and press on copy to file button. Create crt file as instructed.
Open up Chrome Settings > Show advanced settings > HTTPS/SSL > Manage Certificates. Select Trusted Roots tab and import the crt file here. Edit this certificate and mark all check boxes.
Restart Chrome
It's 2022 now and web everywhere is using https protocol. Sooner or later the hacks and workarounds in this post will become more and more annoying or not work anymore. If you are developing web applications, even for testing, you will need to either get a free SSL certificate or issue your own certificate for in-house uses.
For free certificates, there are three popular web sites providing this service:
https://www.sslforfree.com/
https://letsencrypt.org/
https://zerossl.com/
If you're developing a local web application for your company intranet, you should generate your own SSL certificate using OpenSSL with the information below.
If you would like to generate your own certificates for different purposes, using the latest OpenSSL tool (version 3.0 series) becomes very convenient and relatively easy, too. Just follow the steps listed on this SocketTools page.
https://sockettools.com/kb/creating-certificate-using-openssl/
I have just completed and make our internal web server and application free of security warnings on any browsers. Once you've got familiar with the simple commands and you will be able to expand the OpenSSL uses to other web application projects.
I was trying to run my first .net Core web app in chrome and had same error. Using Version 84.0.4147.135 of Chrome.
To Resolve (quick fix),
When you run the application you will see two options 'Advanced' and 'Back to safety' on page, shown by chrome browser.
Click Advanced button, it will show you 'Proceed to localhost(unsafe)'. Click that and your application should work.
(I know above one is not a actual fix. The actual resolution is about adding localhost certificate as trusted root certificate.)
If you want to install certificate - When you will see error and if you click on error - 'NET::ERR_CERT_AUTHORITY_INVALID' it will show you certificate. Copy that and install into trusted root. I tried that however it didn't resolved my issue. I will update it if get resolution to this.
Just figured out how to solve this! Click on the Debug tab in the top menu and click on Debug Properties (right below Options), then scroll down and uncheck Enable SSL. Now try debugging your application again and it should work! It may take a minute to load but it definitely solves the problem...
I also had the same problem. By default Chrome uses google.com which didn't work for me but google.com.bd worked for me(I live in Bangladesh). So if u live in for example in the UK, google.com.uk might work.
Go to this link it will help,
https://superuser.com/questions/169014/chrome-set-search-bar-to-google-co-uk-not-google-com
For angular apps using ng serve, you might have something like this in your package.json file:
"start:windows": "ng serve --port 44470 --ssl --ssl-cert %APPDATA%\\ASP.NET\\https\\%npm_package_name%.pem --ssl-key %APPDATA%\\ASP.NET\\https\\%npm_package_name%.key",
Go to that folder, e.g. C:\Users\{username}\AppData\Roaming\ASP.NET\https, and delete the .key and .pem files for your project. Next time you run it should regenerate them correctly.

Visual Studio remotebuild for iOS fails with Error: self signed certificate in certificate chain

I have a Mac mini configured as the remotebuild server. Remote building my cordova app to the Mac was working ok in secure mode for a while but I was suddenly greeted with a Error: self signed certificate in certificate chain.
I've followed several suggestions of running the commands,
remotebuild certificates reset
remotebuild certificates generate
then updating the pin accordingly in Visual Studio to no avail. I can build successfully when running in non-secure mode.
remotebuild --secure-mode false
I've also tried cleaning my solution in VS2015, nuking the certs folder on the Mac and re-installing remotebuild. It may be worth noting that something in the build process was constantly corrupting the remote_ios.json file so I was having to keep removing that file to build every other time as explained here.
Any ideas on how to get around this error or why it would suddenly be a point of failure?
This "self signed certificate in certificate chain" error can happen if remotebuild generates a certificate under one identity (hostname / ip address) and is accessed via another one. The client will look at the certificate and find that it doesn't match what it expected, and so it does not trust the server. My guess is that it began failing for you due to a change in your network architecture.
If you know the identity that other machines will attempt to use, for example if they will use some.buildserver.local, then you can instruct remotebuild to generate a certificate using that identity via remotebuild --hostname="some.buildserver.local" --secure=true saveconfig && remotebuild certificates reset && remotebuild certificates generate.
Once you have created new certificates that should match client expectations, if you reconfigure them then they should accept the server's certificate.
Also apart from those I did restart my client computer as well.

Access Development server with self-signed SSL Certificate

My app needs to connect to an internal web server through https.
The server has a self-signed certificate that is valid until next year:
I have installed this certificate in the iOS Simulator and on the device (Certificate.cer):
I am watching the traffic with Charles and the request does not even "leave" my computer.
The problem seems to be due to the SSL Certificate because when I can access the server through the internal url and the port 8080 everything works fine.
I did try the hack with the category allowsAnyHTTPSCertificateForHost:. This did not work in the simulator as well as on the device.
There seems to be official API to do this: How to use NSURLConnection to connect with SSL for an untrusted cert?
However, since this is only my development environment I would prefer not to change my code base for now. Plus I am using a framework to parse my data and I might have to deeply interfere with that framework to get to the API described above.
So my question is, should it not be possible to install the certificate and then use the server as if there was an official SSL certificate.
Email the self-signed certificate to yourself then open it on your iPhone. You will be taken through the steps to install the certificate on your phone.

Xcode bots server continuous integration hangs on "Getting sources..."

I setup a copy of OSX server and correctly configured it with Xcode. I was able to create a bot and run a few integrations which failed because I didn't import the correct developer certificates. Running an integration now it seems to be stuck at "Getting sources.." while Xcode is showing it as being queued. Any ideas?
There are lot of reasons this might be happening and it depends on what version control system you are using. For both git and svn the issue might be the root ssl certificates. You need to add the root certificates from your keychain to your ssl configuration.
See this post for details.
If the problem isn't SSL certificate related then it will likely be a timeout issue fetching your source repository if it is very large. Check your integration logs for details.

Bot integration with local repository

I am trying to create bot with my local repository created on mac. But integration fails always. I am using simulator for testing. I have also selected simulators from device settings.
But getting following error always-
SSH Known Hosts file path is located at /Library/Server/Xcode/Config/ssh_known_hosts
SSH strict host checking is enabled (you can disable this by editing the SSHStrictHostKeyChecking key in /Library/Server/Xcode/Config/xcsbuildd.plist
Untrusted HTTPS certificates is disabled (you can enable this by editing the TrustSelfSignedSSLCertificates key in /Library/Server/Xcode/Config/xcsbuildd.plist
ab59d95ce4458b340114a7aefb9f16479f05982b refs/heads/master
SSH Known Hosts file path is located at /Library/Server/Xcode/Config/ssh_known_hosts
SSH strict host checking is enabled (you can disable this by editing the SSHStrictHostKeyChecking key in /Library/Server/Xcode/Config/xcsbuildd.plist
Untrusted HTTPS certificates is disabled (you can enable this by editing the TrustSelfSignedSSLCertificates key in
/Library/Server/Xcode/Config/xcsbuildd.plist
Do I need to generate ssh key?
I have generated ssh key also but how can I add it for local repository on my mac
Plz help if u have any idea.
Thanks
Actually, this article might have the answer to your problem:
Missing xcsbuildd.plist file on OS X 10.9 Server
Actually, if you pointing bot to a git via https, so these messages are not errors, they are warnings. I have two bots now and they goes to our internal git server by https, and successfully fetching sources and displays this message anyway.
As you said, your integration fails. If bot can't get sources, it will write that checkout sources failed.
To understand what actually goes wrong you should look through the Build Failure Log under the Logs tab in the your integration in the Xcode or in the safari. (I would recommend you to look in the safari because if your log is huge, safari will load it much faster than Xcode). Yeah, it's not very comfortable, but it's not very hard. At some point you'll see the git command arguments and, perhaps, error reason a few lines below.
After configuring everything as it should be in Xcode Server, I get two different results.
When I create a bot in Xcode: internal-checkout-error.
When I create a bot in Safari: Works like a charm.
Both with the exact same project, the exact same Xcode Server host. Apple did more than their usual level of obfuscation, here...

Resources