Skip to content

Commit 14b75d4

Browse files
Merge pull request #2143 from allmightyspiff/master
updated internal readme
2 parents 9d96e4e + 01648bb commit 14b75d4

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

README-internal.md

+35-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
This document is for internal users wanting to use this library to interact with the internal API. It will not work for `api.softlayer.com`.
22

3+
## SSL: CERTIFICATE_VERIFY_FAILED fix
4+
You need to specify the server certificate to verify the connection to the internal API since its a self signed certificate. Python's request module doesn't use the system SSL cert for some reason, so even if you can use `curl` without SSL errors becuase you installed the certificate on your system, you still need to tell python about it. Further reading:
5+
- https://hackernoon.com/solving-the-dreadful-certificate-issues-in-python-requests-module
6+
- https://levelup.gitconnected.com/using-custom-ca-in-python-here-is-the-how-to-for-k8s-implementations-c450451b6019
7+
8+
On Mac, after installing the softlayer.local certificate, the following worked for me:
9+
10+
```bash
11+
security export -t certs -f pemseq -k /System/Library/Keychains/SystemRootCertificates.keychain -o bundleCA.pem
12+
sudo cp bundleCA.pem /etc/ssl/certs/bundleCA.pem
13+
```
14+
Then in the `~/.softlayer` config, set `verify = /etc/ssl/certs/bundleCA.pem` and that should work.
15+
316

417
## Certificate Example
518

@@ -11,14 +24,14 @@ endpoint_url = https://<internal api endpoint>/v3/internal/rest/
1124
timeout = 0
1225
theme = dark
1326
auth_cert = /etc/ssl/certs/my_utility_cert-dev.pem
14-
server_cert = /etc/ssl/certs/allCAbundle.pem
27+
verify = /etc/ssl/certs/allCAbundle.pem
1528
```
1629

1730
`auth_cert`: is your utility user certificate
1831
`server_cert`: is the CA certificate bundle to validate the internal API ssl chain. Otherwise you get self-signed ssl errors without this.
1932

2033

21-
```
34+
```python
2235
import SoftLayer
2336
import logging
2437
import click
@@ -37,4 +50,23 @@ if __name__ == "__main__":
3750
testAuthentication()
3851
```
3952

40-
## Employee Example
53+
## Employee Example
54+
55+
To login with your employee username, have your config look something like this
56+
57+
*NOTE*: Currently logging in with the rest endpoint doesn't quite work, so use xmlrpc until I fix [this issue](https://github.ibm.com/SoftLayer/internal-softlayer-cli/issues/10)
58+
59+
```
60+
[softlayer]
61+
username = <softlayer domain username>
62+
endpoint_url = https://<internal api endpoint>/v3/internal/xmlrpc/
63+
verify = /etc/ssl/certs/allCAbundle.pem
64+
```
65+
66+
You can login and use the `slcli` with. Use the `-i` flag to make internal API calls, otherwise it will make SLDN api calls.
67+
68+
```bash
69+
slcli -i emplogin
70+
```
71+
72+
If you want to use any of the built in commands, you may need to use the `-a <accountId>` flag.

0 commit comments

Comments
 (0)