uwdoem/connection

There is no license information available for the latest version (3.0.0) of this package.

Helper library for connecting to the university's x.509 secured web services

3.0.0 2017-11-15 22:24 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:13:51 UTC


README

Build Status Code Climate Test Coverage Latest Stable Version

UWDOEM/Connection

Connection is a PHP helper library for connecting to the university's x.509 secured web services. Connection is used by uwdoem/person to connect to the university's person and student web services.

Installation

You can use Connection directly by including it in your composer.json file require statements:

  "require": {
    ...
    "uwdoem/connection": "2.*",
    ...
  },

Of course it is possible to use Connection without Composer by downloading it directly, but use of Composer to manage packages is highly recommended. See Composer for more information.

Troubleshooting

This library will throw warnings and exceptions when it recognizes an error. Turn on error reporting to see these. The following conditions will halt execution:

cURL Error Code 77

Problem: cURL cannot find the UWCA root certificate to verify the identify of the PWS/SWS servers.

Solution: Download the .crt root CA bundle to your server, ensure that your web-server process has read access to this bundle, and uncomment/edit the curl.cainfo line in your php.ini to reflect the location of this bundle.

cURL Error Code 58

Problem: cURL is having a problem using your private key.

Solution: You may have provided an incorrect private key password to ::createConnection. If your private key requires a password, provide one, and ensure that it is correct.

No such file found for SSL key/certificate

Problem: Connection cannot find the key and/or certificate at the path you provided to ::createConnection.

Solution: Ensure that you provided the correct path to these files and that your web-server process has read-access to these files.

Incorrect password for SSL key, but you're providing the correct SSL key password

Problem: This might be caused by a bug in the system cURL, which might cache your SSL keys; it seems that cURL can confuse these keys and use apply the wrong password to a key.

Solution: Only use one SSL key on one server, or make all SSL keys passwordless.

Script execution halts/no output

Problem: This might be caused by an internal error in cURL while accessing your private key/certificate which causes PHP to die unexpectedly.

Solution: I was able to solve this by setting permissions on my key/certificate to read only. Specifically, I turned off write access for all parties.

Requirements

  • PHP 5.5, 5.6, 7.0
  • cURL

Todo

See GitHub issue tracker.

Getting Involved

Feel free to open pull requests or issues. GitHub is the canonical location of this project.

Here's the general sequence of events for code contribution:

  1. Open an issue in the issue tracker.
  2. In any order:
  • Submit a pull request with a failing test that demonstrates the issue/feature.
  • Get acknowledgement/concurrence.
  1. Revise your pull request to pass the test in (2). Include documentation, if appropriate.