├── .gitignore
├── README.md
├── pom.xml
├── src
└── main
│ └── java
│ └── it
│ └── zero11
│ └── acme
│ └── example
│ ├── LetsEncryptDemo.java
│ ├── FTPChallengeListener.java
│ └── SFTPChallengeListener.java
└── LICENSE.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /.settings/
3 | /.classpath
4 | /.project
5 | *.crt
6 | *.csr
7 | *.key
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java ACME Client Let's Encrypt DEMO
2 |
3 | This is a demo client using the [Java ACME Client Library](https://github.com/zero11it/acme-client).
4 | This demo ask to the Let's Encrypt CA to sign a certificate for a domain using an FTP Account to perform the domain validation.
5 |
6 | ## Contributions
7 |
8 | Contributions are welcome, but there are no guarantees that they are accepted as such. Process for contributing is the following:
9 | - Fork this project
10 | - Create an issue to this project about the contribution (bug or feature) if there is no such issue about it already. Try to keep the scope minimal.
11 | - Develop and test the fix or functionality carefully. Only include minimum amount of code needed to fix the issue.
12 | - Refer to the fixed issue in commit
13 | - Send a pull request for the original project
14 | - Comment on the original issue that you have implemented a fix for it
15 |
16 | ## License & Author
17 |
18 | Java ACME Client is distributed under Apache License 2.0. For license terms, see LICENSE.txt.
19 |
20 | Java ACME Client is written by Zero11
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | it.zero11
5 | acme-client-letsencrypt-demo
6 | 0.1.2
7 |
8 | Java ACME Client Let's Encrypt demo
9 | This is a demo client using the Java ACME Client Library
10 |
11 | https://github.com/zero11it/acme-client-letsencrypt-demo
12 |
13 |
14 |
15 | Apache License, Version 2.0
16 | http://www.apache.org/licenses/LICENSE-2.0.txt
17 | repo
18 |
19 |
20 |
21 |
22 | https://github.com/zero11it/acme-client-letsencrypt-demo
23 |
24 |
25 |
26 |
27 | it.zero11
28 | acme-client
29 | 0.1.2
30 |
31 |
32 | commons-net
33 | commons-net
34 | 3.3
35 |
36 |
37 | org.glassfish.jersey.core
38 | jersey-client
39 | 2.18
40 |
41 |
42 | com.jcraft
43 | jsch
44 | 0.1.50
45 |
46 |
47 |
48 |
49 |
50 |
51 | org.apache.maven.plugins
52 | maven-compiler-plugin
53 |
54 | 1.7
55 | 1.7
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/src/main/java/it/zero11/acme/example/LetsEncryptDemo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 Zero11 S.r.l.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package it.zero11.acme.example;
18 |
19 | import it.zero11.acme.Acme;
20 | import it.zero11.acme.AcmeChallengeListener;
21 | import it.zero11.acme.storage.impl.DefaultCertificateStorage;
22 |
23 | import java.io.IOException;
24 |
25 | import org.bouncycastle.operator.OperatorCreationException;
26 | import org.bouncycastle.x509.util.StreamParsingException;
27 |
28 | public class LetsEncryptDemo {
29 | private static final String CA_STAGING_URL = "https://acme-staging.api.letsencrypt.org/acme";
30 | private static final String CA_PRODUCTION_URL = "https://acme-v01.api.letsencrypt.org/acme";
31 | private static final String AGREEMENT_URL = "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf";
32 |
33 | public static void main(String args[]) throws IOException, OperatorCreationException, InterruptedException, StreamParsingException{
34 | if (args.length != 7){
35 | System.out.println("Usage: java -jar acme-client-letsencrypt-demo.jar <(s)ftpuser> <(s)ftppassword> <(s)ftprootfolder> ");
36 | System.out.println("Currently supported protocols are sftp and ftp");
37 | System.out.println(String.format("The current Let's Encrypt Terms and Conditions you need to agree can be found here: %s", AGREEMENT_URL));
38 | }else if (!args[6].startsWith("mailto:")){
39 | System.out.println("WARNING: contact must start with mailto: ");
40 | }else{
41 | System.out.println("WARNING: this sample application is using the Let's Encrypt staging API. Certificated created with this application won't be trusted.");
42 | System.out.println("By using this application you agree to Let's Encrypt Terms and Conditions");
43 | System.out.println(args[5]);
44 | System.out.println("Press y if you agree to continue");
45 | int response = System.in.read();
46 | if (response == 'y' || response == 'Y'){
47 | String port = "22";
48 | if (args[0].contains(":")){
49 | port = args[0].split(":")[1];
50 | args[0] = args[0].split(":")[0];
51 | }
52 |
53 | String[] domains = args[0].split(",");
54 | AcmeChallengeListener challengeListener;
55 | switch (args[1]){
56 | case "ftp":
57 | challengeListener = new FTPChallengeListener(domains[0], args[2], args[3], args[4]);
58 | break;
59 | case "sftp":
60 | challengeListener = new SFTPChallengeListener(domains[0], Integer.parseInt(port), args[2], args[3], args[4]);
61 | break;
62 | default:
63 | System.out.println("Unknown protocol: " + args[1]);
64 | return;
65 | }
66 |
67 | Acme acme = new Acme(CA_STAGING_URL, new DefaultCertificateStorage(true), true, true);
68 |
69 | acme.getCertificate(domains, args[5], new String[]{args[6]}, challengeListener);
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/it/zero11/acme/example/FTPChallengeListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 Zero11 S.r.l.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package it.zero11.acme.example;
18 |
19 | import it.zero11.acme.AcmeChallengeListener;
20 | import it.zero11.acme.AcmeException;
21 |
22 | import java.io.ByteArrayInputStream;
23 | import java.io.IOException;
24 |
25 | import org.apache.commons.net.ftp.FTPClient;
26 | import org.apache.commons.net.ftp.FTPFile;
27 | import org.apache.commons.net.ftp.FTPReply;
28 |
29 | public class FTPChallengeListener implements AcmeChallengeListener {
30 | private final String host;
31 | private final String username;
32 | private final String password;
33 | private final String webroot;
34 |
35 | public FTPChallengeListener(String host, String username, String password, String webroot) {
36 | this.host = host;
37 | this.username = username;
38 | this.password = password;
39 | this.webroot = webroot;
40 | }
41 |
42 | @Override
43 | public boolean challengeHTTP01(String domain, String token, String challengeURI, String challengeBody) {
44 | return createChallengeFiles(token, challengeBody);
45 | }
46 |
47 | private boolean createChallengeFiles(String token, String challengeBody) {
48 | boolean success = false;
49 | FTPClient ftp = new FTPClient();
50 | try {
51 | ftp.connect(host);
52 | if(!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
53 | ftp.disconnect();
54 | return false;
55 | }
56 |
57 | ftp.login(username, password);
58 | ftp.changeWorkingDirectory(webroot);
59 | ftp.makeDirectory(".well-known");
60 | ftp.changeWorkingDirectory(".well-known");
61 | ftp.makeDirectory("acme-challenge");
62 | ftp.changeWorkingDirectory("acme-challenge");
63 | ftp.enterLocalPassiveMode();
64 | ftp.setFileType(FTPClient.BINARY_FILE_TYPE, FTPClient.BINARY_FILE_TYPE);
65 | ftp.setFileTransferMode(FTPClient.BINARY_FILE_TYPE);
66 | success = ftp.storeFile(token, new ByteArrayInputStream(challengeBody.getBytes()));
67 | if (!success)
68 | System.err.println("FTP error uploading file: " + ftp.getReplyCode() + ": " + ftp.getReplyString());
69 | ftp.logout();
70 | } catch(IOException e) {
71 | throw new AcmeException(e);
72 | } finally {
73 | if(ftp.isConnected()) {
74 | try {
75 | ftp.disconnect();
76 | } catch(IOException ioe) {
77 | }
78 | }
79 | }
80 |
81 | return success;
82 | }
83 |
84 | @Override
85 | public void challengeCompleted(String domain) {
86 | deleteChallengeFiles();
87 | }
88 |
89 | private void deleteChallengeFiles() {
90 | FTPClient ftp = new FTPClient();
91 | try {
92 | ftp.connect(host);
93 | if(!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
94 | ftp.disconnect();
95 | return;
96 | }
97 |
98 | ftp.login(username, password);
99 | ftp.changeWorkingDirectory(webroot);
100 | ftp.changeWorkingDirectory(".well-known");
101 | ftp.changeWorkingDirectory("acme-challenge");
102 |
103 | FTPFile[] subFiles = ftp.listFiles();
104 |
105 | if (subFiles != null && subFiles.length > 0) {
106 | for (FTPFile aFile : subFiles) {
107 | String currentFileName = aFile.getName();
108 | if (currentFileName.equals(".") || currentFileName.equals("..")) {
109 | continue;
110 | }else{
111 | ftp.deleteFile(currentFileName);
112 | }
113 | }
114 | }
115 | ftp.changeToParentDirectory();
116 | ftp.removeDirectory("acme-challenge");
117 | ftp.changeToParentDirectory();
118 | ftp.removeDirectory(".well-known");
119 | ftp.logout();
120 | } catch(IOException e) {
121 | throw new AcmeException(e);
122 | } finally {
123 | if(ftp.isConnected()) {
124 | try {
125 | ftp.disconnect();
126 | } catch(IOException ioe) {
127 | }
128 | }
129 | }
130 | }
131 |
132 | @Override
133 | public void challengeFailed(String domain) {
134 | deleteChallengeFiles();
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/src/main/java/it/zero11/acme/example/SFTPChallengeListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 Zero11 S.r.l.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package it.zero11.acme.example;
18 |
19 | import it.zero11.acme.AcmeChallengeListener;
20 | import it.zero11.acme.AcmeException;
21 |
22 | import java.io.ByteArrayInputStream;
23 | import java.io.IOException;
24 | import java.util.Vector;
25 |
26 | import org.bouncycastle.operator.OperatorCreationException;
27 | import org.bouncycastle.x509.util.StreamParsingException;
28 |
29 | import com.jcraft.jsch.Channel;
30 | import com.jcraft.jsch.ChannelSftp;
31 | import com.jcraft.jsch.ChannelSftp.LsEntry;
32 | import com.jcraft.jsch.JSch;
33 | import com.jcraft.jsch.JSchException;
34 | import com.jcraft.jsch.Session;
35 | import com.jcraft.jsch.SftpException;
36 |
37 | public class SFTPChallengeListener implements AcmeChallengeListener {
38 | private final String host;
39 | private final int port;
40 | private final String username;
41 | private final String password;
42 | private final String webroot;
43 |
44 | public SFTPChallengeListener(String host, int port, String username, String password, String webroot) {
45 | this.host = host;
46 | this.port = port;
47 | this.username = username;
48 | this.password = password;
49 | this.webroot = webroot;
50 | }
51 |
52 | @Override
53 | public boolean challengeHTTP01(String domain, String token, String challengeURI, String challengeBody) {
54 | return createChallengeFiles(token, challengeBody);
55 | }
56 |
57 | private boolean createChallengeFiles(String token, String challengeBody) {
58 | boolean success = false;
59 | JSch jsch = new JSch();
60 | Session session = null;
61 | try {
62 | session = jsch.getSession(username, host, port);
63 | session.setPassword(password);
64 | java.util.Properties config = new java.util.Properties();
65 | config.put("StrictHostKeyChecking", "no");
66 | session.setConfig(config);
67 | session.connect();
68 | Channel channel = session.openChannel("sftp");
69 | channel.connect();
70 | ChannelSftp channelSftp = (ChannelSftp) channel;
71 | channelSftp.cd(webroot);
72 |
73 | try{
74 | channelSftp.mkdir(".well-known");
75 | }catch(Exception e){}
76 | channelSftp.cd(".well-known");
77 |
78 | try{
79 | channelSftp.mkdir("acme-challenge");
80 | }catch(Exception e){}
81 | channelSftp.cd("acme-challenge");
82 |
83 | channelSftp.put(new ByteArrayInputStream(challengeBody.getBytes()), token, ChannelSftp.OVERWRITE);
84 |
85 | channelSftp.disconnect();
86 | session.disconnect();
87 |
88 | success = true;
89 | } catch (SftpException e) {
90 | return false;
91 | } catch (JSchException e) {
92 | throw new AcmeException(e);
93 | } finally {
94 | if(session != null && session.isConnected()) {
95 | session.disconnect();
96 | }
97 | }
98 |
99 | return success;
100 | }
101 |
102 | @Override
103 | public void challengeCompleted(String domain) {
104 | deleteChallengeFiles();
105 | }
106 |
107 | private void deleteChallengeFiles() {
108 | JSch jsch = new JSch();
109 | Session session = null;
110 | try {
111 | session = jsch.getSession(username, host, port);
112 | session.setPassword(password);
113 | java.util.Properties config = new java.util.Properties();
114 | config.put("StrictHostKeyChecking", "no");
115 | session.setConfig(config);
116 | session.connect();
117 | Channel channel = session.openChannel("sftp");
118 | channel.connect();
119 | ChannelSftp channelSftp = (ChannelSftp) channel;
120 | channelSftp.cd(webroot);
121 |
122 | channelSftp.cd(".well-known");
123 | channelSftp.cd("acme-challenge");
124 |
125 | Vector subFiles = channelSftp.ls(".");
126 |
127 | if (subFiles != null && subFiles.size() > 0) {
128 | for (LsEntry aFile : subFiles) {
129 | String currentFileName = aFile.getFilename();
130 | if (currentFileName.equals(".") || currentFileName.equals("..")) {
131 | continue;
132 | }else{
133 | channelSftp.rm(currentFileName);
134 | }
135 | }
136 | }
137 | channelSftp.cd("..");
138 | channelSftp.rmdir("acme-challenge");
139 | channelSftp.cd("..");
140 | channelSftp.rmdir(".well-known");
141 |
142 | channelSftp.disconnect();
143 | session.disconnect();
144 | } catch (SftpException e) {
145 | //throw new AcmeException(e);
146 | } catch (JSchException e) {
147 | //throw new AcmeException(e);
148 | } finally {
149 | if(session != null && session.isConnected()) {
150 | session.disconnect();
151 | }
152 | }
153 | }
154 |
155 | @Override
156 | public void challengeFailed(String domain) {
157 | deleteChallengeFiles();
158 | }
159 | }
160 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
--------------------------------------------------------------------------------